Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Guys,
Need your support please.
I have the following matrix, How can I sort the table from largest to smallest based on last day values?
Thank you
Solved! Go to Solution.
Hi @abukapsoun
This is my test table:
Please create a measure:
Measure =
var _maxdate=MAXX(ALLSELECTED('Table'),[Date])
var _sum= CALCULATE(SUM('Table'[Value]),FILTER('Table',[Date]=_maxdate))
return
IF(HASONEVALUE('Table'[Date]),SUM('Table'[Value]),_sum)
Create a matrix visual. The column subtotals will become the last day value as below shown, then you can sort from largest to smallest based on last day values:
If you don't want to show column subtotals, you can switch off column subtotals after sorting.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @abukapsoun
This is my test table:
Please create a measure:
Measure =
var _maxdate=MAXX(ALLSELECTED('Table'),[Date])
var _sum= CALCULATE(SUM('Table'[Value]),FILTER('Table',[Date]=_maxdate))
return
IF(HASONEVALUE('Table'[Date]),SUM('Table'[Value]),_sum)
Create a matrix visual. The column subtotals will become the last day value as below shown, then you can sort from largest to smallest based on last day values:
If you don't want to show column subtotals, you can switch off column subtotals after sorting.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, for this measure, if last column has no value then it takes value from previous column. How to adjust measure so if there is no value , there is no value?
Hi @abukapsoun ,
I think that it is not possible to sort a column in a matrix, but it is possible to sort a measure in a matrix. You have to find the way to create a measure only for the last day.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |