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

The current week's ranking

Hi all,

 

I have a data model that consists of two tables: "Data" and "DATES". In the data model there's a column called "Revenue" and a column called "Dealstate (Progress)". I have created a measure that sums up EMEA revenue where the DealState (Progress) = "Won". That measure is:


EMEA Won MRR With Access = CALCULATE(SUM('Data'[Revenue], 'Data'[DealState (Progress)] = "Won")

 

I have a page that looks at a weekly view. Each week has a number associated with it in the Dates table, the column is called 'Week' and is based on the WEEKNUM() function.

 

I need to create measure that:
Creates a rank for each week based on the value of the "EMEA Won MRR With Access" measure, with the highest rank (1) being the week with the highest value of EMEA Won MRR With Access. I then need to be able to output the current week's ranking on a card visual.

 

For example, if there's data like this in the DATA table (Date/Revenue)

 

03/01/2022100
07/01/2022250
11/01/202260
12/01/202210
25/01/202290
26/01/2022500

 

We can see there are 3 weeks of data (although there are technically 6 'weeks' in Jan 2022) so the DATES table would go up to week 6 in Jan:

 

LightTheWay_0-1673528662690.png

If we assume that the data ends at the end of January, so we have 6 weeks to rank, in the above example, there are 3 weeks with data and 3 weeks without, so the real ranking would look something like this:

LightTheWay_1-1673528845347.png

Now let's think bigger. Let's imagine it's August 1st - I'm in week 32, and I don't want a table of 32 ranks, I just want a card value that says the current week's rank number. This will always be the current (maximum) week as it'll form part of a weekly report. And we can also assume that no weeks will ever tie in rank so we don't need to worry about errors.

 

I've tried playing with various SUMX and SUMMARIZE measures, but have had no luck. 

 

I would appreciate any help at all, thank you.

 

 

 

1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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.