cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jessicaloureiro
Frequent Visitor

Top N Amount (with month columns)

Hello,

 

First, sorry for my english, im from brazil 🙂

 

So, im trying to create a view of a table like this:

jessicaloureiro_0-1642763973728.png

 

 I need to rank by the total, but when i try to do that it shows the rank in each month (Example: top N of january, top N of feb...)

 

 I found this template that helped me to create the view only with the total, but now i dont know how to bring the top N  of the total amount with the months columns:  https://www.dropbox.com/s/59cct4in6zqbxaj/Sales%20Top%20Other.pbix?dl=1

 

Does anyone know how to do that?

 

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @jessicaloureiro ;

Is your problem solved? If so, Would you mind accept the helpful replies as solutions? Then we could close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
Community Support

Hi, @jessicaloureiro ;

Try to create a measure as follows:

Measure = 
var _rank=
 RANKX(FILTER(ALL(Table1),MONTH([Date])=MONTH(MAX([Date]))), CALCULATE(SUMX(FILTER(ALL(Table1),[country]=MAX([country])&&MONTH([Date])=MONTH(MAX([Date]))),[sales])),,DESC,Dense)
return IF(_rank<=MONTH(MAX([Date])),SUM([sales]))

The final output is shown below:

vyalanwumsft_0-1643089976884.png
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!