Forum Discussion
Sorting based on last column
- 3 years ago
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.
- Ania261 year agoHelper IV
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?