Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
I would like to create a column "Week Duration" start from Sunday to Saturday.
For example:
23-Aug-20 to 29-Aug-20
30-Aug-20 to 05-Sep-20
06-Sep-20 to 12-Sep-20
After "Week Duration" column is created, how to sort it by descending order in line chart?
Expected Output:
Solved! Go to Solution.
Hi, @PBI_newuser
You can try the following steps.
1 Create a Calculated column
rank_column = RANKX(data,INT(data[Week Start Date]),,DESC,Dense)
2 Sort ‘Week Duration’ column by this column
The result looks like this:
Here is the pbix.
Best Regards,
Caiyun Zheng
Hi, @PBI_newuser
You can create a column with whole number as its value and then sort your “Week Duration” column with this column. You can refer this article Sort a Column with a Custom Order in Power BI.
Best Regards,
Caiyun Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-cazheng-msft , thanks for your suggestion. But the week duration is continous and updating everyday. How can I create a column with whole number for that? Sample data here.
Hi, @PBI_newuser
You can try the following steps.
1 Create a Calculated column
rank_column = RANKX(data,INT(data[Week Start Date]),,DESC,Dense)
2 Sort ‘Week Duration’ column by this column
The result looks like this:
Here is the pbix.
Best Regards,
Caiyun Zheng
if the format is sortable then from three dots you can choose week and Sort descending.
Otherwise, create a sort column and mark that as the sort column
refer my video : https://youtu.be/KK1zu4MBb-c
or https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
Hi @amitchandak , it doesn't work for my case.
Could you please take a look at my file?