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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Index based on other column

Delion_0-1642998261418.png

 

Hi, I want to create index based on column Week and use this column for sort in Bar chart

 

Many thank

 

1 ACCEPTED SOLUTION

@Anonymous , if you have date this needs to be created based on date

 

new columns

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
VahidDM
Super User
Super User

Hi @Anonymous 

 

You can add a new column to your table to show the YYYY number + Week number like this:

202101

202102

.

.

.

202153
202201
202202

 

then use that to create a RANK column.

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

ALLUREAN
Solution Sage
Solution Sage

Hi, @Anonymous 

Do you use calendar date table or this is the data structure?




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Anonymous
Not applicable

Data structure

Please check this example in that case:

Weeks are ordered by 1-53

https://www.dropbox.com/s/xf3ttggw31a6w5h/Index%20based%20on%20other%20column%20%28allure-analytics....

 

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/

https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA

https://www.linkedin.com/company/77757292/




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




@Anonymous , if you have date this needs to be created based on date

 

new columns

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors