Forum Discussion
TopN measure on multiple columns
Hello,
I am having a problem when trying to use TopN function.
I have this measure :
- the COUNTROWS function at the end is just to check if the measure works.
- The Trx Count is just a measure we have to calculate the total transactions.
2 Replies
- amitchandak
Super User
fhdalsafi , TOPN returns table that act as filter, Not meausre
Usages example
calculate([Measure], TOPN( 1,allselected(Table[Column]),[Measure],DESC), values(Table[column])))
refer if needed
TOPN: https://www.youtube.com/watch?v=QIVEFp-QiOk&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=42
- AnonymousNot applicable
Hi fhdalsafi
TOPN can return results in batches, returning all the first N rows of records that meet the conditions from a table. Its role is equivalent to a filter not a measure or column to calculate a value .
You can learn more through the link below .
https://docs.microsoft.com/en-us/dax/topn-function-dax
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.