Forum Discussion
SteveIOW
Helper II
4 years agoTOPN doesn't work as a filter
Good morning. I have used WorstModTrend = TOPN ( 1 , VALUES ( Modalities[Modality] ), CALCULATE([Avg Rise (M)]) , DESC ) to identify the modality with the worst trend. I now want to identify...
- 4 years ago
Think I have done it myself - by taking a completely different approach.
WorstTrend = MAXX(SUMMARIZE(Modalities, Modalities[Modality], "Rise", LinearRegTable[Avg Rise (M)]), LinearRegTable[Avg Rise (M)])I'm sure there is a better way although this gives the right answer. If anyone can give me the another way I will be interested.Cheers
amitchandak
Super User
4 years agoSteveIOW , You should try like
WorstTrend = CALCULATE([Avg Rise (M)], Modalities[Modality] , TOPN ( 1 , VALUES ( Modalities[Modality] ), CALCULATE([Avg Rise (M)]) , DESC ))
do you need bottom means asc
WorstTrend = CALCULATE([Avg Rise (M)], Modalities[Modality] , TOPN ( 1 , VALUES ( Modalities[Modality] ), CALCULATE([Avg Rise (M)]) , asc))
refer
- SteveIOW4 years ago
Helper II
amitchandak thanks for having a look at this for me.
I have tried as you have written but of course it does not provide a boolean output so it fails. I tried putting in an = instead of a comma but that also fails as below.
- SteveIOW4 years ago
Helper II
Think I have done it myself - by taking a completely different approach.
WorstTrend = MAXX(SUMMARIZE(Modalities, Modalities[Modality], "Rise", LinearRegTable[Avg Rise (M)]), LinearRegTable[Avg Rise (M)])I'm sure there is a better way although this gives the right answer. If anyone can give me the another way I will be interested.Cheers