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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Top 5 for each month

Hi Everyone,

I want to show top 5 records for every month based on "Type" column for last 6 months data (Ex. Top 5 vaues for Jan , Top 5 for Feb etc) in a line graph.

So based on Type field I want to create 3 reports,

1. Top 5 Server names for % Processor Time by month.

2. Top 5 Server names for % Memory used by month.

3. Top 5 Server names for % Local Disk used by month.
Untitledpost.png

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

One way:

create  two measures for each type, for example for "% Processor Time", then add one measure in the visual level filter as below:

Processor_value = CALCULATE(SUM('Table 2'[value]),FILTER('Table 2','Table 2'[name]="% Processor Time"))

Processor_rank = RANKX(FILTER(ALLSELECTED('Table 2'),'Table 2'[name]="% Processor Time"&&'Table 2'[monthyear]=MAX('Table 2'[monthyear])),[Processor_value],,DESC,Dense)

Capture3.JPG

Another way:

add filter and measure in the visual level filter

rankall = RANKX(FILTER(ALLSELECTED('Table 2'),'Table 2'[monthyear]=MAX('Table 2'[monthyear])),CALCULATE(SUM('Table 2'[value])),,DESC,Dense)

Capture4.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

One way:

create  two measures for each type, for example for "% Processor Time", then add one measure in the visual level filter as below:

Processor_value = CALCULATE(SUM('Table 2'[value]),FILTER('Table 2','Table 2'[name]="% Processor Time"))

Processor_rank = RANKX(FILTER(ALLSELECTED('Table 2'),'Table 2'[name]="% Processor Time"&&'Table 2'[monthyear]=MAX('Table 2'[monthyear])),[Processor_value],,DESC,Dense)

Capture3.JPG

Another way:

add filter and measure in the visual level filter

rankall = RANKX(FILTER(ALLSELECTED('Table 2'),'Table 2'[monthyear]=MAX('Table 2'[monthyear])),CALCULATE(SUM('Table 2'[value])),,DESC,Dense)

Capture4.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

KBO
Memorable Member
Memorable Member

Hi @Anonymous ,

have you try to use under the Filter Pane the option Filtertype and change it to TopN? And then add the field you like to reference and apply. Then I would choose a date filter to select with the relative date option the last six month.

Otherwise you can use DAX measures to do it.

 

Best,

Kathrin

 

 

 

 

If this post has helped you, please give it a thumbs up!
Did I answer your question? Mark my post as a solution!

Anonymous
Not applicable

Yes I tried it but I want show for each months

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.