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.
Hi there!
I need to do a percentage calculation of two different measures, but I need one to be filtered and one to be ALL.
Below are my measures:
SalesCount= DISTINCTCOUNT(Sales[PurchaseID]) -----To get the total number of sales
GradesOut= CALCULATE(DISTINCTCOUNT(Sales[PurchaseID]),FILTER(Purchases,Purchases[GradeDiff]>0)) --- to get all sales graded >0
Now I need to work out the percentage of GradesOut / SalesCount.......... but so that the SalesCount stays the same even after I have used a visualisation filter on the GradesOut.
I have used %GradesOut=DIVIDE([GradesOut],[SalesCount]))
This gives me the correct percentage, until I begin to filter. Then it changes my percentages to 100% and my number of SalesCount to equal the number of GradesOut.
If someone could help I would be eternally greatful!
Please see below.
Solved! Go to Solution.
I have found a solution!
1) SalesCount= DISTINCTCOUNT(Sales[PurchaseID])
2) GradesOut= CALCULATE(DISTINCTCOUNT(Sales[PurchaseID]),FILTER(Purchases,Purchases[GradeDiff]>0))
3) AllSales = CALCULATE([SalesCount],ALL(Sales))
4) %Of Sales = DIVIDE([GradesOut],[AllSales],0)
What does making SalesCount = distinctcount(all(sales[PurchaseID])) do?
I get the following error message:
The syntax for ')' is incorrect. (DAX(distinctcount(all(sales[PurchaseID]))))).
I have found a solution!
1) SalesCount= DISTINCTCOUNT(Sales[PurchaseID])
2) GradesOut= CALCULATE(DISTINCTCOUNT(Sales[PurchaseID]),FILTER(Purchases,Purchases[GradeDiff]>0))
3) AllSales = CALCULATE([SalesCount],ALL(Sales))
4) %Of Sales = DIVIDE([GradesOut],[AllSales],0)
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |