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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

How to count no. of values calculated by a measure >

Hi Everyoen, 

 

I have a measure which calculate On time Delivery % of each supplier I use a table from our ERP system which mark each line as late in the status column if it passes the due delivery date 

 

Lots Total = CALCULATE(count(OTD[Recipt Date]))
Late lots = CALCULATE(COUNTROWS(OTD),OTD[Status]="late")
OTD% = CALCULATE(DIVIDE([Lots Total]-[Late lots],[Lots Total])
 
I display those results per supplier each month using a column chart
 
i need to calculate the number of suppliers who have score above of 90% 
 
and the number of suppliers between 90% and 80%
 
is it possible to have these count from the values 
1 ACCEPTED SOLUTION

@Anonymous , 

You need to use FILTER function with CALCULATE

CALCULATE(DISTINCTCOUNT(Table[Suppliers]),FILTER(TABLE,[OTD%]>0.9))

CALCULATE(DISTINCTCOUNT(Table[Suppliers]),FILTER(TABLE,[OTD%]>0.9 && [OTD%]<0.8))

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

7 REPLIES 7
manikumar34
Solution Sage
Solution Sage

@Anonymous 

Try something like this.

 

CALCULATE(DISTINCTCOUNT(Table[Suppliers]),[OTD%]>0.9)

CALCULATE(DISTINCTCOUNT(Table[Suppliers]),[OTD%]>0.9 && [OTD%]<0.8)

 

Keep OTD% data type in decimals if the above is not working with percentage.

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Anonymous
Not applicable

When I tried this formula I got an error 

"A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

 

any thoughts

@Anonymous , 

You need to use FILTER function with CALCULATE

CALCULATE(DISTINCTCOUNT(Table[Suppliers]),FILTER(TABLE,[OTD%]>0.9))

CALCULATE(DISTINCTCOUNT(Table[Suppliers]),FILTER(TABLE,[OTD%]>0.9 && [OTD%]<0.8))

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Anonymous
Not applicable

Thank you very much this actualy worked for >90 and between 90 and 85 

 

but When I try to make one more measure for values less than 0.85 I got higher values than normal as if he counts the whole list 

here's my formula 

<0.85 = CALCULATE(DISTINCTCOUNT('60 supplier Master List 2020'[Supplier]),FILTER('60 supplier Master List 2020',[OTD%]< 0.85))

Formula is fine. That should work. 

Can you reverify the count again and check. 

 

Regards,

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




@Anonymous , 

If your problem solved, can you Mark this answer as a Solution to help others. 

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




amitchandak
Super User
Super User

@Anonymous , one way is to create measures like

 

> 90 = countx(filter(summarize(Table, Table[supplier], "_1",[OTD%]),[_1]>.9),[supplier])
>80 < 90 = countx(filter(summarize(Table, Table[supplier], "_1",[OTD%]),[_1]>.8 && [_1]<=.9),[supplier])

 

or create a Dynamic segmentation using an independent table on [OTD%]. Refer my video

https://www.youtube.com/watch?v=CuczXPj0N-k

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.