Forum Discussion
mbudiman
Helper III
1 year agoTop N based on specific column in MATRIX table
hi, I want to show Top Product (by Sub Main Category) based on Net Revenue for Current Fiscal Quarter, and also shows corresponding Net Revenue for last 3 Fiscal Quarter. I use Matrix table and Top N...
- Anonymous1 year ago
Hi mbudiman ,
Please try code as below.
New Net Revenue = IF ( HASONEVALUE ( 'Table'[FY_FISCAL_QTR] ), [Net Revenue], CALCULATE ( [Net Revenue], FY_FISCAL_QTR,FY_FISCAL_QTR[QTR_SEQ_NO] = 0 ) )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
1 year agoNot applicable
Hi mbudiman ,
According to your statement, I think you want to sort the category by the last FY_FISCAL_QTR.
As far as I know, when you sort the matrix by data in value field, Power BI will sort it by subtotal.
So I suggest you to try code as below to diy the subtotal for [Net Revenue].
New Net Revenue =
IF (
HASONEVALUE ( 'Table'[FY_FISCAL_QTR] ),
[Net Revenue],
CALCULATE (
[Net Revenue],
'Table'[FY_FISCAL_QTR] = MAX ( DimDate[FY_FISCAL_QTR] )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.