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.
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |