Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Percentages 100% Help!

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.

 

Filter Issues.png

 




1 ACCEPTED SOLUTION
Anonymous
Not applicable

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)

 

 

View solution in original post

3 REPLIES 3
jthomson
Solution Sage
Solution Sage

What does making SalesCount = distinctcount(all(sales[PurchaseID])) do?

Anonymous
Not applicable

I get the following error message:

The syntax for ')' is incorrect. (DAX(distinctcount(all(sales[PurchaseID]))))).

Anonymous
Not applicable

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)

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors