The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have created a Calcucated Column and getting output as below.
Overdue
Due Today
Not Due Today
I have added that column in a Matrix in Columns area. But i am getting the column sequence as below.
Whereas i need in the below sequence.
Overdue | Due Today | Not Due Today
How can i do that please?
Solved! Go to Solution.
Hi @AkshayManke,
Sorting the "Due Status" column as per your expectations is possible. We can use the Sort By Column functionality in Power BI to achieve the desired sorting, though we need to keep in mind to avoid circular dependency while sorting. Please follow the steps below -
Due Status Order =
SWITCH(
Products[Due Status],
"Overdue", 1,
"Due Today", 2,
"Not Due Today", 3
)
Voila! The columns in the matrix should now be sorted
Before Sorting:
After Sorting:
This behaviour is very well explained using the following diagrams available here
Let me know if you have any questions!
Hi @AkshayManke;
You can add a new column to set an index for that column, using something like this:
Index =
SWITCH(
TRUE(),
T_OutboundDelivery[DueStatus] ="Overdue", 1,
T_OutboundDelivery[DueStatus] = "Due Today", 2,
T_OutboundDelivery[DueStatus] ="Not Due Today",3
)
And after select the column where you have Overdue information and sort that column by the index column that you created, like this:
Proud to be a Super User!
I had the same problem as @AkshayManke ,
I solved it by doing this:
I made a conditional column, with the ranks I wanted.
So in this case, when Overdue = 1, Due Today = 2, Not Due Today = 3 (called ranks).
Then I made this ranks column a number type (I also made it a sum).
Then I sorted the table on the basis of the ranks column. This causes that the initally column also got sorted in the right way.
When I tried again in the matrix, I got the sequence I wanted.
Maybe this also helps for you.
I had the same problem as @AkshayManke ,
I solved it by doing this:
I made a conditional column, with the ranks I wanted.
So in this case, when Overdue = 1, Due Today = 2, Not Due Today = 3 (called ranks).
Then I made this ranks column a number type (I also made it a sum).
Then I sorted the table on the basis of the ranks column. This causes that the initally column also got sorted in the right way.
When I tried again in the matrix, I got the sequence I wanted.
Maybe this also helps for you.
Hi @AkshayManke;
You can add a new column to set an index for that column, using something like this:
Index =
SWITCH(
TRUE(),
T_OutboundDelivery[DueStatus] ="Overdue", 1,
T_OutboundDelivery[DueStatus] = "Due Today", 2,
T_OutboundDelivery[DueStatus] ="Not Due Today",3
)
And after select the column where you have Overdue information and sort that column by the index column that you created, like this:
Proud to be a Super User!
Hi @_AAndrade,
I tried with your approach too. But getting below error. Could you please suggest next steps?
Thanks and Regards,
@AkshayManke,
This measure is saying that you have more than one index for the same status, so you have some issue in your data or in the Index formula.
Could you please share more information?
Proud to be a Super User!
Hi @AkshayManke,
Sorting the "Due Status" column as per your expectations is possible. We can use the Sort By Column functionality in Power BI to achieve the desired sorting, though we need to keep in mind to avoid circular dependency while sorting. Please follow the steps below -
Due Status Order =
SWITCH(
Products[Due Status],
"Overdue", 1,
"Due Today", 2,
"Not Due Today", 3
)
Voila! The columns in the matrix should now be sorted
Before Sorting:
After Sorting:
This behaviour is very well explained using the following diagrams available here
Let me know if you have any questions!
Hello @Bipin-Lala , Bipin,
I tried with the steps but getting the above error while trying to sort column based on the newly created. Could you please help what additionally needs to be done?
Thanks and Regards,
Hi @AkshayManke,
It seems like for each Status value, you are assigning multiple values of S Sort, which is causing this issue. Could you please share the DAX formula you used for creating the Status and S Sort columns?
Also, some more information about the data would be helpful, such as does the Status column contains any blanks, etc.
Hello @Bipin-Lala, @_AAndrade, and @Tom02,
Apologies for late reply. Actually after trying all the possibilities i simply added numbers in prefix in the expected order and now i am getting the expected output. Below the DAX which finally i used.
Status =
IF(
'Tasks List'[Completion] = "Not-Started" &&
'Tasks List'[PlannedEndDate]='Tasks List'[Today] ,
"2. Due Today",
IF(
'Tasks List'[Completion] = "Not-Started" &&
'Tasks List'[PlannedEndDate]<'Tasks List'[Today],
"1. Overdue",
"3. Not Due Today"
)
)
However many thanks for your quick suggestions and help.
I am marking both of your responces as solutions.
Thanks and Regards,
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
81 | |
62 | |
54 |
User | Count |
---|---|
246 | |
119 | |
114 | |
87 | |
70 |