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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
j_gan2022
Frequent Visitor

Dynamic Group By Row Count

 

I want these feature in my report

1) create a passing grade which is X% of the top scorer. eg. Top scorer = 80, if X% = 50%, passing grade = 40.

2) createa a slicer that can adjust X%.

3) a visual that can show how many passed or fail based on the slicer

Please advise how can I do it. I have created a measure for point 2) but i can't use the measure for group by to achieve 3).

 

Student IDScore
166
277
343
445
570
680
755
850
976
1020
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@j_gan2022 , when you create what if, you will get a what if measure, of you can get like

whatif measure = maxx(allselected(whatif) , whatif[value])

 

measure 

1. when score is a column
countrows(filter(table, table[Score] >= [whatif measure]))

 

 

1. when score is a measure
countX(filter(values(table[Student ID]), [Score] >= [whatif measure]), [Student ID])

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

View solution in original post

4 REPLIES 4
Thejeswar
Super User
Super User

Hi @j_gan2022

You can use the what if parameters to achieve this

 

1. Create what if parameter, this will create a slicer and a measure as well

2. Create another measure as follows

checkcondition = if(SUM(exam[Score]) > mark_what_if[mark_what_if Value], 1, 0)
3. Use this new measure as visual filter to the visual where you want to dynamically filter the data based on selection
Thejeswar_1-1644229848353.png

 


 

Hi, I can't use 2) as slicer. Can you show me how to use as a slicer instead? Thanks

Hi,

You can create a column with the below DAX. This column you can use in a slicer

checkconditioncolumn = if(exam[Score] > mark_what_if[mark_what_if Value], 1, 0)

Thejeswar_0-1644231543166.png

 

amitchandak
Super User
Super User

@j_gan2022 , when you create what if, you will get a what if measure, of you can get like

whatif measure = maxx(allselected(whatif) , whatif[value])

 

measure 

1. when score is a column
countrows(filter(table, table[Score] >= [whatif measure]))

 

 

1. when score is a measure
countX(filter(values(table[Student ID]), [Score] >= [whatif measure]), [Student ID])

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.