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

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.

Reply
pigip
Frequent Visitor

Get the number of item based on multiple column

Hello, PowerBI Guru , I have a table as below, I would like to make a DAX to calculate how many component’s pass ratio ([Pass Test]/[Total Amount]) is more than 95%. I need to get the result per YEAR, YEAR MONTH.  Thanks in advance !

 

ComponentTest DateTotal AmountPass Test
A25/11/201910099
B27/11/2019200198
A14/12/2019120116
B15/12/201910097
16/12/2019150120
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hello

You can download my PBI file from here.

I hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
v-jayw-msft
Community Support
Community Support

Hi @pigip ,

 

Create measures and visual as below.

percentage = SUM('Table'[Pass Test])/SUM('Table'[Total Amount])
pass95 = CALCULATE(DISTINCTCOUNT('Table'[Component]),FILTER('Table',[percentage]>0.95))

8.PNG 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Big thanks ! It also works very well !

Ashish_Mathur
Super User
Super User

Hello

You can download my PBI file from here.

I hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for prompt response. It works

pranit828
Community Champion
Community Champion

HI @pigip 

 

I have created three columns as below.

Year = YEAR([Test Date])
Month = MONTH([Test Date])
Pass_95 = IF(DIVIDE([Pass Test],[Total Amount],0)*100>95,1,0)
 

and use these columns for the visual

 
pranit828_0-1597879024651.png

 

pranit828_1-1597879043427.png

 





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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