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
I have the table:
CustomerName; Country;
I want to calculate the percentage of non-blank CustomerName only when Country=USA.
How can I do that?
Thanks!
Solved! Go to Solution.
Hi @UsePowerBI
if I understand you correct you need
Measure =
DIVIDE(
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table), Table[CustomerName] <> BLANK(), Table[Country]="USA"),
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table), Table[CustomerName] <> BLANK())
)
Hi @UsePowerBI
if I understand you correct you need
Measure =
DIVIDE(
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table), Table[CustomerName] <> BLANK(), Table[Country]="USA"),
CALCULATE(DISTINCTCOUNT(Table[CustomerName]), ALL(Table), Table[CustomerName] <> BLANK())
)
Thanks, can I ask:
1) why you put the ALL(Table)? Doesn't it apply the calculation to the whole table anyway?
2) why you put the Table[CustomerName] <> BLANK() ? I think COUNT already counts the non-blanks anyway?
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |