Forum Discussion
jiinson
Helper I
9 years agoMissing Total
Dear Tutors, I have had problem getting total values from matrix. As you can tell from the picture, total rows are empty. I have a slicer that user can choose Top N Number. When user se...
jiinson
Helper I
9 years agoAnonymous Vvelarde
BTM incidates "Bottom". All the numbers are in Decimal Numbers. It is weird because it works finely on TopN but not Bottom N.
Those are the dax code that I have changed and used.
Performing
TopN Selection = MAX('TopN'[TopN]) # I am using same slicer for TopN and BottomN.
Top Rank = RANKX(ALLSELECTED(Table[Customer]), [CY Calc], , DESC)
CY Calc = CALCULATE(SUM(Table[Sales Amount]), DATESYTD('Date'[Date]))
CY Rank = IF([Top Rank] <= LOOKUPVALUE('TopN'[TopN No], 'TopN'[TopN], [TopN Selection]), [CY Calc], BLANK())
CY GM= IF(and(HASONEVALUE(DM_Costs_Std_USD_Regional[Customer]), [CY Rank]<>0) , [CY Rank]/1000,
IF([CY Rank]<>0, CALCULATE([CY Rank]/1000, FILTER(ALL(Table[Customer]), [CY Rank]<>0))))
PY GM= IF(AND([CY Rank] <>0, HASONEFILTER(Table[Customer])), CALCULATE([CY Calc], SAMEPERIODLASTYEAR('Date'[Date].[Date]))/1000,
IF([CY Rank]<> 0, CALCULATE([CY Calc], SAMEPERIODLASTYEAR('Date'[Date].[Date]), FILTER(ALL(Table[Customer]), [CY Rank]<>0))/1000))Underperforming
Btm Rank = RANKX(ALLSELECTED(Table[Customer]), [CY Calc], , ASC, Dense)
Btm CY Calc = IF([Btm Rank] <= LOOKUPVALUE('TopN'[TopN No], 'TopN'[TopN], [TopN Selection]), [CY Calc], BLANK())
Btm CY = IF(AND(HASONEfilter(Table[Customer]), [Btm CY Calc]<>0), [Btm CY Calc]/1000,
IF([Btm CY Calc] <>0, CALCULATE([Btm CY Calc], FILTER(ALL(Table[Customer]), [Btm CY Calc]<>0))/1000))
Btm PY = IF(AND([Btm CY Calc] <>0, HASONEFILTER(Table[Customer])), CALCULATE([CY GM Calc], SAMEPERIODLASTYEAR('Date'[Date].[Date]))/1000,
IF([Btm CY Calc]<> 0, CALCULATE([CY Calc], SAMEPERIODLASTYEAR('Date'[Date].[Date]), FILTER(ALL(Table[Customer]), [Btm CY Calc]<>0))/1000))
Thanks in advance,
Jiin
v-huizhn-msft
Microsoft Employee
9 years agoHi jiinson,
I am unable to reproduce your scenario using my sample data on my local computer. Is there any chance to share your .pbix file for further analysis?
Best Regards,
Angelia