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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Top n function based on increase/decrease in data over time

I want to create a measure that allows me to find the top 5 and bottom 5 for departments over a course of 2 months.

 

I have already created a measure that finds the percent difference between payments from one month to the next, now I would like to be able to compare and visualize that difference.

 

I want to find the top 5 deparmets with the greatest increase in payments and the bottom 5 departments with the greatest decrease in payments.

 

I'm fairly new to Power BI so I am not sure how to go about doing this. Here is a sample of my data:

 

DATE

DEPARTMENT

PAYMENTS

Increase/Decrease

February

000

12

 

March

000

2

-83%

February

001

312

 

March

001

463

48%

February

002

127

 

March

002

17

-87%

 

I really appreciate the help and I thank you all in advance!

 

 

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

@Anonymous ,

 

Please convert Increase/Decrease to calculate column, then create two tables by clicking Modeling-> New Table using DAX below:

Top 5 Increase = TOPN(5, FILTER('Table', 'Table'[Increase/Decrease] > 0), 'Table'[Increase/Decrease], DESC)

1.PNG 

 

Bottom 5 Decrease = TOPN(5, FILTER('Table', 'Table'[Increase/Decrease] < 0), 'Table'[Increase/Decrease], ASC)

2.PNG 

Community Support Team _ Jimmy Tao

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

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Please convert Increase/Decrease to calculate column, then create two tables by clicking Modeling-> New Table using DAX below:

Top 5 Increase = TOPN(5, FILTER('Table', 'Table'[Increase/Decrease] > 0), 'Table'[Increase/Decrease], DESC)

1.PNG 

 

Bottom 5 Decrease = TOPN(5, FILTER('Table', 'Table'[Increase/Decrease] < 0), 'Table'[Increase/Decrease], ASC)

2.PNG 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.