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.
How can do triple sort for below based on all date ascending (ignoring Blank) in below order-
1st by Date try 1 (Ascending to descending with Non-blanks on top)
2nd by Date try 2( Ascending to descending with Non-blanks on top)
3rd by Date try 3( Ascending to descending -this will always hve some date populated)-
When I make a sort measure and put that in the matrix, it gives blanks on the top if I do Ascending to Descending.
Input Data
Date try 3 | Date try 1 | Date try 2 |
1/07/2022 | 7/07/2022 | 7/07/2022 |
25/06/2022 | 6/07/2022 | 1/07/2022 |
25/06/2022 | 1/07/2022 | 30/06/2022 |
28/06/2022 | 8/07/2022 | |
18/06/2022 | 27/06/2022 | |
25/06/2022 | 7/07/2022 | 1/07/2022 |
25/06/2022 | 6/07/2022 | 1/07/2022 |
1/07/2022 | 6/07/2022 | 7/07/2022 |
1/07/2022 | 30/06/2022 | 7/07/2022 |
28/06/2022 | 8/07/2022 | |
28/06/2022 | 8/07/2022 | |
23/06/2022 | 8/07/2022 | 30/06/2022 |
28/06/2022 | 8/07/2022 | 14/07/2022 |
1/07/2022 | 8/07/2022 | 7/07/2022 |
1/07/2022 | 2/07/2022 | 7/07/2022 |
30/06/2022 | 6/07/2022 | 13/07/2022 |
1/07/2022 | ||
3/07/2022 | ||
1/07/2022 | ||
1/07/2022 | 18/07/2022 | |
21/06/2022 | 27/06/2022 | |
5/07/2022 | 11/07/2022 | |
29/06/2022 | 7/07/2022 | |
29/06/2022 | 7/07/2022 | |
1/07/2022 | 7/07/2022 | |
6/07/2022 | ||
6/07/2022 | ||
25/07/2022 | ||
13/07/2022 | ||
13/07/2022 | ||
3/08/2022 | ||
17/07/2022 | ||
17/07/2022 | ||
13/07/2022 | ||
12/07/2022 | ||
12/07/2022 | ||
12/07/2022 |
Outpur requied
Date try 3 | Date try 1 | Date try 2 |
1/07/2022 | 30/06/2022 | 7/07/2022 |
25/06/2022 | 1/07/2022 | 30/06/2022 |
1/07/2022 | 2/07/2022 | 7/07/2022 |
25/06/2022 | 6/07/2022 | 1/07/2022 |
25/06/2022 | 6/07/2022 | 1/07/2022 |
1/07/2022 | 6/07/2022 | 7/07/2022 |
30/06/2022 | 6/07/2022 | 13/07/2022 |
25/06/2022 | 7/07/2022 | 1/07/2022 |
1/07/2022 | 7/07/2022 | 7/07/2022 |
23/06/2022 | 8/07/2022 | 30/06/2022 |
1/07/2022 | 8/07/2022 | 7/07/2022 |
28/06/2022 | 8/07/2022 | 14/07/2022 |
18/06/2022 | 27/06/2022 | |
21/06/2022 | 27/06/2022 | |
29/06/2022 | 7/07/2022 | |
29/06/2022 | 7/07/2022 | |
1/07/2022 | 7/07/2022 | |
28/06/2022 | 8/07/2022 | |
28/06/2022 | 8/07/2022 | |
28/06/2022 | 8/07/2022 | |
5/07/2022 | 11/07/2022 | |
1/07/2022 | 18/07/2022 | |
1/07/2022 | ||
1/07/2022 | ||
3/07/2022 | ||
3/07/2022 | ||
6/07/2022 | ||
6/07/2022 | ||
8/07/2022 | ||
12/07/2022 |
Solved! Go to Solution.
@learner03 , refer to the video on a similar topic
https://www.youtube.com/watch?v=hdEbtlPVWoM
Hi,
I am not sure if I understood your data model correctly.
I assume you have a kind of index column that differenciates a row that has the same information with other row.
Please check the below picture and the attached pbix file.
I created a sort column inside the table, and showed it toghether in a table visualization.
Sort by condition CC =
IF (
Data[Date try 1] = BLANK (),
0,
RANKX (
FILTER ( Data, Data[Date try 1] <> BLANK () ),
INT ( Data[Date try 1] ),
,
DESC
)
) * 1000000 + Data[Index]
+ IF (
Data[Date try 2] = BLANK (),
0,
RANKX (
FILTER ( Data, Data[Date try 2] <> BLANK () ),
INT ( Data[Date try 2] ),
,
DESC
)
) * 10000 + Data[Index]
+ RANKX (
FILTER ( Data, Data[Date try 3] <> BLANK () ),
INT ( Data[Date try 3] ),
,
DESC
) * 100 + Data[Index]
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure if I understood your data model correctly.
I assume you have a kind of index column that differenciates a row that has the same information with other row.
Please check the below picture and the attached pbix file.
I created a sort column inside the table, and showed it toghether in a table visualization.
Sort by condition CC =
IF (
Data[Date try 1] = BLANK (),
0,
RANKX (
FILTER ( Data, Data[Date try 1] <> BLANK () ),
INT ( Data[Date try 1] ),
,
DESC
)
) * 1000000 + Data[Index]
+ IF (
Data[Date try 2] = BLANK (),
0,
RANKX (
FILTER ( Data, Data[Date try 2] <> BLANK () ),
INT ( Data[Date try 2] ),
,
DESC
)
) * 10000 + Data[Index]
+ RANKX (
FILTER ( Data, Data[Date try 3] <> BLANK () ),
INT ( Data[Date try 3] ),
,
DESC
) * 100 + Data[Index]
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@learner03 , refer to the video on a similar topic
https://www.youtube.com/watch?v=hdEbtlPVWoM
@amitchandak this gives me Non-Blanks at the top but do not sort by Earliest date in matrix
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |