简体   繁体   English

Power BI - 如何从两个表创建度量聚合?

[英]Power BI - How can I create a measure aggregation from two tables?

I've got two tables Fauna_Afetada (animals affected) e Municipios (all cities of the country).我有两张桌子 Fauna_Afetada (受影响的动物) e Municipios (全国所有城市)。 A fauna afetada tem a sigla_uf (state initials which the city belongs to) e nome_municipio (name of the city), as well as the Municipios table.动物区系 afetada tem sigla_uf(城市所属的州首字母)和 nome_municipio(城市名称)以及 Municipios 表。

  • I'd like to create a measure counting the number of deaths (Situação_Int = 0 in table Fauna_Afetada, specify that the animal died) by city (table Municipios).我想创建一个按城市(表 Municipios)计算死亡人数的度量(表 Fauna_Afetada 中的 Situação_Int = 0,指定动物死亡)。 The way to join these tables is by using two columns (the sigla_uf and nome_municipio), because each Municipio in Fauna_Afetada might appear several times.连接这些表的方法是使用两列(sigla_uf 和 nome_municipio),因为 Fauna_Afetada 中的每个 Municipio 可能出现多次。 How do I do that?我怎么做?
  • I'd like to create a measure with the name of the city with the highest number of deaths.我想用死亡人数最多的城市的名称创建一个度量值。

Anyone could help?任何人都可以帮忙吗?

The data model is below.数据 model 如下。

在此处输入图像描述

It seems it is a data modeling issue in the first galce, The model is full of bidirectional relationships that lead to not expect calculations behaviors.似乎这是第一个 galce 中的数据建模问题,model 充满了导致不期望计算行为的双向关系。

Can you share the file or part of it你能分享文件或其中的一部分吗

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在Power BI中创建引用两个不共享关系的表的度量? - Can a measure be created in Power BI that references two tables that share no relationship? 在 Power BI Measure 中按其他两个表中的值筛选表 - Filter Table by Values from two other tables in Power BI Measure 如何创建可以根据 Power BI 中的切片器选择动态更改的度量? - How can I create a measure that can dynamically change according to a slicer selection in Power BI? 如何创建过滤器,以过滤Power BI可视表上的度量“生成”的值? 可能吗? - How can I create a filter that filter values “generated” by a measure on a visual table on Power BI? Is it possible? Power BI - 从 Measure 创建表 - Power BI - Create table from Measure 如何在 SQL 查询中引用 Power BI 度量? - How can I reference a Power BI measure in a SQL query? Power BI 无法在两个表之间创建关系 - Power BI Can't create relationship between two tables 如何在Power BI中的“计算所得”列中使用度量? - How can I use a measure in calculated column in Power BI? 结束表的 Power BI 聚合 - Power BI Aggregation of End Tables 在 Power BI 中,当值(佣金)在不同日期发生变化时,如何从两个不同的表创建新列? - How to create a new column from two different tables when the values (commission) change in different dates, in power BI?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM