cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Top N filter for measure

Hi, 

I have a measure that computes DoD variation, I use this measure in a table but i would like to have only the top 10 value of this measure. Unfortunatly in the Filter option I can only filter by (is above, below, equal etc... ). 

Do you know if it's possible to have the top N filter for a measure ? 

thanks in advance,

Pierre

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Top N filter for measure

Hi @pitucc,

 

You need add the TOPN to one of the other fields of your table based on that measure not to the measure itself. As you can see in the example below have a simple table with dates and sales in my date I have put the top 5 Total_Sales and it gives me the expected result on the sales it's only available what you describe.

 

This happens because the measure are used based in context so based on the context you have you only have one number for that certain context so the TOPN wihtout being related with another value don't make sense that's why you need to apply the TOPN to another column based on your measure and not on your measure itself.

 

TOP_N.png

 

Dont' mind the values they are formatted as % because of a test I was doing.

 

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: Top N filter for measure

Hi @pitucc,

 

You need add the TOPN to one of the other fields of your table based on that measure not to the measure itself. As you can see in the example below have a simple table with dates and sales in my date I have put the top 5 Total_Sales and it gives me the expected result on the sales it's only available what you describe.

 

This happens because the measure are used based in context so based on the context you have you only have one number for that certain context so the TOPN wihtout being related with another value don't make sense that's why you need to apply the TOPN to another column based on your measure and not on your measure itself.

 

TOP_N.png

 

Dont' mind the values they are formatted as % because of a test I was doing.

 

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

Highlighted
Super User IV
Super User IV

Re: Top N filter for measure

I wonder if you could use a measure that included a VAR of a SUMMARIZE statement to summarize the data. This summarized data would include the measure and then you could create a TOPN of that? Just a thought. Have a look at this design pattern:

 

https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

 

Might steer you in the right direction.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Helper I
Helper I

Re: Top N filter for measure

Hi MFelix, it works perfectly many thanks ! 

Cheers,

Pierre

 

Highlighted
Frequent Visitor

Re: Top N filter for measure

Hi. How can I get this to work in the Web Service?  Is it possible?]]

 

Thanks

 

Albin

Frequent Visitor

Re: Top N filter for measure

hi. did you get it to work in the web as well?  How?

 

Thanks,

 

Albin

Highlighted
Super User III
Super User III

Re: Top N filter for measure

On the web service it works in the same way as in the desktop version.

 

So only need to go to the filter and select TOP N.

 

regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog:

Power BI em Português





Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors