简体   繁体   中英

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). 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.

  • 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). 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. 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.

在此处输入图像描述

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.

Can you share the file or part of it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM