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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Get the Best Performing Month and compare to the whole year

Hi, 

I am working on a measure that will return the best performing Month and then I need to divide it by the whole year. The Best Month is simply the month with the highest price sum. I have order duplicates, since one order can have multiple items with different prices.

 

I have searched online, but I'm still unable to get this. 

 

My Data is something like this:

matheuses_0-1669012351858.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , create a rank like this and filter rank =1

 

rankx(filter(allselected(Table[Year], Table[Month]), Table[Year] = max(Table[Year])), calculate(Sum(Table[price])),,desc,dense)

 

Measure Rank: https://www.youtube.com/watch?v=DZb_6j6WuZ0&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=40

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
h

Anonymous
Not applicable

Hi, @amitchandak, I tried your solution, but it didn't really work. I created two columns for the year and month and substituted them in the formula, but in the end it returned 1 for everything. I tried to mess around with the formula to try to make it work, but I was unsuccessful to do so.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.