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
Anonymous
Not applicable

Filter Top 30 Clients for each month

I'm new to Power BI and DAX and I couldn't find a solution to my probelm.

 

I have a table like below image. Profiles have total revenue, gross profit and gross profit percenteages against month. I wanted to  filter top 30 profiles for each month baesd on revenue using DAX.

 

 

Capture.PNG

So far I tried TOPN function which filter top 30 porifles from all data.

TOPN(30, 'Profile Info', 'Profile Info'[Total Revenue])

But what I wanted is filter top profiles of each month.

 

Can someone hlep me on this?

 

Thank you 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Here's a link to pbix that i have created. It shows top 30 products for every month in slicer as per the measure 'Total Sales'.

https://1drv.ms/u/s!AikPceQOhqFEhAUDFBJndxNic9jy?e=171rsT

 

Thanks.

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi,

You can add a TopN filter from the filter pane and add your measure in the 'By Value' field as below:

The below filter will only show the Top 10 counties by 'Total Cost' measure.

result.PNG

Thanks.

Anonymous
Not applicable

Hi thank you. 

This is not my requirement. I want to get top 30 profiles for each month and based on those 30 profiles I have to create top 5 visualizations as mentioned in the example

Anonymous
Not applicable

Hi,

Could you please share some sample data and expected output in an excel.

Thanks.

Anonymous
Not applicable

Hi I have modified my question.What I wanted from my data set is to filter top 30 profiles based on revenue for each month using a dax quey. 


@Anonymous wrote:

Hi,

Could you please share some sample data and expected output in an excel.

Thanks.


 

Anonymous
Not applicable

Here's a link to pbix that i have created. It shows top 30 products for every month in slicer as per the measure 'Total Sales'.

https://1drv.ms/u/s!AikPceQOhqFEhAUDFBJndxNic9jy?e=171rsT

 

Thanks.

Anonymous
Not applicable


@Anonymous wrote:

Here's a link to pbix that i have created. It shows top 30 products for every month in slicer as per the measure 'Total Sales'.

https://1drv.ms/u/s!AikPceQOhqFEhAUDFBJndxNic9jy?e=171rsT

 

Thanks.


Thank you so much. This helped to do the ranking.But I tried a Bottom N filter to filter the lowest values from top 30 list. Returns nothing. May be I'm in a misunderstanding of how top n filter works. Can you help me on that?  https://drive.google.com/file/d/1uTBS6GCIaRc2R6uxX8Vyf4Ti-pupKaxk/view?usp=sharing

 

Thanks. 

Anonymous
Not applicable

Hi,

To get the Bottom 5 from the Top 30 you have 2 options:

Option 1: With current setting, Add a 'Product Rank' filter in the second visual as below

result.PNG

 

Option 2:

Create a new measure and in TopN filter get only Top 5 fields.

Product Rank Bottom = RANKX( ALL(Product_Data), [Total Sales], , ASC )

I have added the file with Option 1 on Ondrive at below location:

https://1drv.ms/u/s!AikPceQOhqFEhAfno1QRMNg4kgXg?e=MyXikI

 

Thanks.

Thanks.

Anonymous
Not applicable


@Anonymous wrote:

Hi,

To get the Bottom 5 from the Top 30 you have 2 options:

Option 1: With current setting, Add a 'Product Rank' filter in the second visual as below

result.PNG

 

Option 2:

Create a new measure and in TopN filter get only Top 5 fields.

Product Rank Bottom = RANKX( ALL(Product_Data), [Total Sales], , ASC )

I have added the file with Option 1 on Ondrive at below location:

https://1drv.ms/u/s!AikPceQOhqFEhAfno1QRMNg4kgXg?e=MyXikI

 

Thanks.

Thanks.



Sorry. I have misinterpreted the scenario. I wanted to use the bottom n filter not on  the raking field but with another field to the top 30 records.

Can you please have a look ? Smiley Happy

 

https://drive.google.com/open?id=1EyL7c-LxHI2GRUFWo8ibe1jrmkXlpiEI

 

Thank you

Anonymous
Not applicable



Hi I have found a solution for that. Thank you for your help Smiley Happy

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.