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
ajjava
New Member

ONE TopN measure that returns the correct TopN data, based on dynamic column selection?

Good evening,

I'm a very seasoned/advanced Excel user, but am just getting my feet wet with Power Query, M language, DAX.

I'm not sure if what I'm asking is possible, and it's easier to show vs explain.  

 

Data set is below (actually a subset). I need to be able to show the TopN for SUM OF GROSS INCURRED TOTAL.

I learned how to create/use measures to accomplish this, BUT, the example I learned from was limited to just ONE hard-coded column/dimension from the data set (it was STATE).

 

Here are the measures:

sample data set MEASURES.jpg

 

What if I wanted to use a slicer to select from ANY of the columns/dimensions, and have the TopN returned, based on that slicer selection? Is that possible? Does that logically even make sense? 

 

Thanks for helping out a little fish in a HUGE pond 😀

 

Here is my data set (table name is APPEND1). In reality, there are 20-30 columns/dimensions for a user to choose from:

sample data set.jpg

 

And this is roughly the output I'm looking for (so, instead of being limited to STATE, the output would summarize by whatever happened to be placed in the row field of the pivot):

 

sample data set TOP 5jpg.jpg

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ajjava , In case you need TOPN with others refer

Power BI- Power BI- TOPN with Others- https://youtu.be/I_TY4hVlzAE

 

In case you want to switch TOPN

Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

View solution in original post

2 REPLIES 2
ajjava
New Member

Thank you, Amit. This is very close to the solution I was looking for. I will post back here, as soon as I work my way through the part that has me hung up. 

amitchandak
Super User
Super User

@ajjava , In case you need TOPN with others refer

Power BI- Power BI- TOPN with Others- https://youtu.be/I_TY4hVlzAE

 

In case you want to switch TOPN

Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

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.