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
Spudder112
Helper I
Helper I

Can't Rank my Week Ending Dates with Rankx

The below is the table I am working with, and I want to rank by week ending date.

 

Spudder112_1-1659630248683.png

 

I am trying to formula :

 
Week Rank = RANKX(All('Table 1'),'Table 1'[week ending date],,ASC,Dense)
 
But I get the error:
 
A single value for column 'week ending date' in table 'Table 1' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
 
The week ending dates look like the below, so I don't understand why it isn't working. Any help appreciated!
Spudder112_2-1659630494811.png

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Spudder112 , Hope you are creating a column not measure

This should work as column

Week Rank = RANKX(('Table 1'),'Table 1'[week ending date],,ASC,Dense)

 

Also it is always better to have a separate Date/week Table

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Spudder112 , Hope you are creating a column not measure

This should work as column

Week Rank = RANKX(('Table 1'),'Table 1'[week ending date],,ASC,Dense)

 

Also it is always better to have a separate Date/week Table

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

Ah, I was using the measure feature instead of column. Thank you! Also for reminding me to make a separate date table.

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.

Top Solution Authors