Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
Need help on calculating the percentage then display the percentage for a selected state in a card.
I have two tables.
Table 1 contains weekly subject counts for each state.
State | Week | Counts |
AL | 1 | 2 |
AL | 2 | 1 |
AL | 3 | 5 |
AL | 4 | 3 |
GA | 1 | 1 |
GA | 2 | 5 |
GA | 3 | 6 |
GA | 4 | 1 |
Tabel 2 contains the population of each state.
State | Pop |
AL | 120 |
GA | 150 |
A many-to-one single direction (table2->table1) relationship was set up. Now I want to calculated the percentage of counts/population for each state and put the percertage in the card. For example. AL will be (2+1+5+3)/120=0.09
Thank you!
Sam
Solved! Go to Solution.
Hi @Sam10
take a look at the following solution:
Percentage Counts/Population =
VAR _StateValue = MIN(Population[Pop])
VAR _SumOfCounts = SUM('Table'[Counts])
RETURN
DIVIDE(_SumOfCounts,_StateValue)
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
Hi @Sam10
take a look at the following solution:
Percentage Counts/Population =
VAR _StateValue = MIN(Population[Pop])
VAR _SumOfCounts = SUM('Table'[Counts])
RETURN
DIVIDE(_SumOfCounts,_StateValue)
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
Works like a charm! Thank you.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |