Forum Discussion
JP8991
Kudo Commander
2 years agoTOPN Not Working As Expected (Driving me nuts)
The purpose of my table is to show Debt by accounts and I would like to only display the top 20, to do this I am using the TOPN as a visual filter on the table by Account ID (from fact table), it is ...
v-jincheng-msft
Community Support
2 years agoHi JP8991 ,
The reason TOPN does not work as expected is that the relationship between the tables is one-to-many, so the target value cannot be obtained directly.
Please try Creating and using the following MEASURE:
CenterCode = var _max=
MAXX(
FILTER(ALL('Debt Detail'),'Debt Detail'[Amount ID]=MAX('Debt Detail'[Amount ID])),[Date])
return
MAXX(
FILTER(ALL('Debt Detail'),
'Debt Detail'[Date]=_max),[Center Code])
Hope it helps!
Best regards,
Community Support Team_ Joseph Ji
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- JP89912 years ago
Kudo Commander
v-jincheng-msft thanks so much for your help.
Would you be able to provide the PBIX for this as you referenced [Centre Code] as a measure however I don't have this has a measure.
Thanks,James