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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
cmcgo3
Helper II
Helper II

Power BI Dax Measure

cmcgo3_0-1692910023094.png

I also wanted to add a table underneath that would give you totals.  For this example, Total Students 20, Count of automobile I would want 3 and then percentage of total ...20 students / 3 chevrolet .15 or 15%.  Any help would be greatly appreciated !!

 

I am trying to add another feature; having some challenges with creating a measure....

 

cmcgo3_1-1692910023099.png

 

 

 

Flag =

var _count=COUNTX(ALLSELECTED('Scores'),'Scores'[name])

var _per=_count*0.30

var _rank=RANKX(ALLSELECTED('Scores'),CALCULATE(SUM('Scores'[score])),,DESC)

return

IF(

    _rank<=_per,1,0)

 

Total Students = COUNTROWS(FILTER('Scores','Scores'[Flag]=1))

 The output for total students is 20; which is correct.

 

How would I write a measure that would capture what type of automobile a student drives based on the filtered total of 20.  For example, of those 20 students, 3 students have "Chevrolet" as automobile.  What measure would you write to get a total of 3?

 

I have been "stuck" on trying to create this calculation.

 

Best Regards,

 

Chris C.

 

 

 

 

4 REPLIES 4
cmcgo3
Helper II
Helper II

I was able to resolve my problem!  Thank you!!

parry2k
Super User
Super User

@cmcgo3 sorry still not clear, better to share a sample pbix file with the expected output. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

cmcgo3
Helper II
Helper II

Thanks for your reply!  For example, with two filters; the city Philadelphia for week 1, data shows 17 students; which is correct..  The 17 students represents 25% of the entire student population. I want bottom box to show 17 students and 3 "count of automobile" if filter for Chevrolet is selected.   It gets tricky for me when trying to get calculations with multiple filters selected.  I appreciate any help!

parry2k
Super User
Super User

@cmcgo3 your screenshots are so hard to read, can you share sample data and what you are trying to achieve? 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.