Forum Discussion
MATRIX SORTING
- Anonymous5 years ago
Hi Gareth_Hunt ,
From my test, I could sort decending correctly by YS revenue. Please try:
Method1:
YS-Revenue = CALCULATE ( SUM ( DCalandar[Invoice] ), FILTER ( 'DCalandar', 'DCalandar'[Customer] = MAX ( 'DCalandar'[Customer] ) && YEAR ( 'DCalandar'[Date] ) = YEAR ( MAX ( 'DCalandar'[Date] ) ) ) )Method2:Calculate the sum separately:
2018 YS-revenue = CALCULATE ( SUM ( 'DCalandar'[Invoice] ), FILTER ( 'DCalandar', 'DCalandar'[Customer] = MAX ( 'DCalandar'[Customer] ) && YEAR ( 'DCalandar'[Date] ) = 2018 ) )2019 YS-revenue = CALCULATE ( SUM ( 'DCalandar'[Invoice] ), FILTER ( ALL ( 'DCalandar' ), 'DCalandar'[Customer] = MAX ( 'DCalandar'[Customer] ) && YEAR ( 'DCalandar'[Date] ) = 2019 ) )Method3:Use rank
Measure= RANKX ( ALL ( 'DCalandar' ), [2019 YS-revenue],, DESC, DENSE )Did I answer your question ? Please mark my reply as solution. Thank you very much.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Eyelyn Qin
Hi Gareth_Hunt ,
From my test, I could sort decending correctly by YS revenue. Please try:
Method1:
YS-Revenue =
CALCULATE (
SUM ( DCalandar[Invoice] ),
FILTER (
'DCalandar',
'DCalandar'[Customer] = MAX ( 'DCalandar'[Customer] )
&& YEAR ( 'DCalandar'[Date] ) = YEAR ( MAX ( 'DCalandar'[Date] ) )
)
)
Method2:Calculate the sum separately:
2018 YS-revenue =
CALCULATE (
SUM ( 'DCalandar'[Invoice] ),
FILTER (
'DCalandar',
'DCalandar'[Customer] = MAX ( 'DCalandar'[Customer] )
&& YEAR ( 'DCalandar'[Date] ) = 2018
)
)2019 YS-revenue =
CALCULATE (
SUM ( 'DCalandar'[Invoice] ),
FILTER (
ALL ( 'DCalandar' ),
'DCalandar'[Customer] = MAX ( 'DCalandar'[Customer] )
&& YEAR ( 'DCalandar'[Date] ) = 2019
)
)
Method3:Use rank
Measure=
RANKX ( ALL ( 'DCalandar' ), [2019 YS-revenue],, DESC, DENSE )
Did I answer your question ? Please mark my reply as solution. Thank you very much.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Eyelyn Qin