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.
I have a measure with 3 text responses: A,B,C. I want to calculated some percentages and rates, such as A/C, A/(A+B+C), etc.
I tried getting count values of all these responses then using those but it did not work, here is what I attempted:
A Count = IF('Data'[Measure]="A"1,0)
B Count = IF('Data'[Measure]="B"1,0)
C Count = IF('Data'[Measure]="C"1,0)
When trying to simply calulate rates as so:
A rate = SUM('Data'[A Count])/(SUM('Data'[A Count])+SUM('Data'[B Count])+SUM('Data'[C Count]))
It will not let me reference my calculated fields for A,B,C count. This seems like a very simple calculation I am just fundamentally missing something.
I also need to calculate some rates between this first measure and another IE: Measure 2 with responses (1,2,3):
[A Count] / [2 Count], etc
Any thoughts?
Solved! Go to Solution.
Hi @trevordunham ,
I created some data:
Here are the steps you can follow:
1. Create measure.
A/C =
DIVIDE(
SUMX(ALL(Data),[A Count]) , SUMX(ALL(Data),[C Count]))
A/(A+B+C) =
DIVIDE(
SUMX(ALL(Data),[A Count]) , SUMX(ALL(Data),[A Count]) + SUMX(ALL(Data),[B Count]) +SUMX(ALL(Data),[C Count]))
A rate =
SUMX(ALL(Data),'Data'[A Count])/SUMX(ALL(Data),'Data'[A Count])+SUMX(ALL(Data),'Data'[B Count])+SUMX(ALL(Data),'Data'[C Count])
2. Result:
If I have misunderstood your meaning, please provide your desired output and your pbix file without privacy information.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @trevordunham ,
I created some data:
Here are the steps you can follow:
1. Create measure.
A/C =
DIVIDE(
SUMX(ALL(Data),[A Count]) , SUMX(ALL(Data),[C Count]))
A/(A+B+C) =
DIVIDE(
SUMX(ALL(Data),[A Count]) , SUMX(ALL(Data),[A Count]) + SUMX(ALL(Data),[B Count]) +SUMX(ALL(Data),[C Count]))
A rate =
SUMX(ALL(Data),'Data'[A Count])/SUMX(ALL(Data),'Data'[A Count])+SUMX(ALL(Data),'Data'[B Count])+SUMX(ALL(Data),'Data'[C Count])
2. Result:
If I have misunderstood your meaning, please provide your desired output and your pbix file without privacy information.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
It may sound simple but it is in fact rather complex. You will have to throw away your original measures and design completely new measures from scratch, based on the logic for the individual comparisons. Likely includes SUMX as well etc.
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to work with. Avoid posting screenshots of your source data if possible.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
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 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |