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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.