The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
CountryValueYear
USA | 1 | 2023 |
France | 3 | 2023 |
Canada | 1 | 2023 |
USA | 2 | 2024 |
France | 1 | 2024 |
Canada | 6 | 2024 |
For the data above , I have amtrix table:
How can I sort by the last column? 2024. descending?
Solved! Go to Solution.
Hey there!
You could try creating a Sort Column in Power Query
Sort the Matrix Table Using This Column
Ensure Sorting Order
If sorting directly is not working, create a DAX measure to rank countries based on the 2024 values:
Then, sort the matrix by Rank2024 instead.
Hope this helps!
😁😁
Hi @Ania26 ,
We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
Hi @Ania26 ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra E
Hi @Ania26 ,
We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
Hi @Ania26 ,
Thank you for reaching out to Microsoft Community.
Try to make sorting dynamic, based on the latest visible year in the matrix. So you can dynamically pick the latest visible year (e.g., 2024 now, maybe 2025 later), sort countries by their value in that latest year.
Create a measure to identify the latest visible year:
LatestVisibleYear =
MAX('Table'[Year])
and now create a measure to return value for the latest visible year to calculate the sum of values only for the latest visible year, dynamically.
ValueforlatestYear =
VAR LatestYear = CALCULATE(MAX('Table'[Year]), ALLSELECTED('Table'))
RETURN
CALCULATE(
SUM('Table'[Value]),
'Table'[Year] = LatestYear
)
Use this measure to sort your matrix, sort the matrix by ValueforlatestYear descending.
If this issue has been resolved, consider accepting helpful replies as solutions.
Regards,
Chaithra E.
Hello, Thank you for this but this will not work when someone will filter other than 2024 year.
Hey there!
You could try creating a Sort Column in Power Query
Sort the Matrix Table Using This Column
Ensure Sorting Order
If sorting directly is not working, create a DAX measure to rank countries based on the 2024 values:
Then, sort the matrix by Rank2024 instead.
Hope this helps!
😁😁