Forum Discussion

Pbiuserr's avatar
Pbiuserr
Post Prodigy
4 years ago

TOP N for a chart with two values

Hello,

I have value Sales Amount and Sales Amount LY in a chart (made out of field parameter, 5 dimensions) and I created a TOPN slicer alike in this video youtube.com/watch?v=SsZseKOgrWQ 

It works, but because I have two measures in values, it indeed filter Sales Amount, but they it also displays whatever category has Sales Amount LY. Is there anything I can do to just see TOP N of Sales Amount and if its selected, dont mind LY (just corresponding LY to TOP N values?)

 

 

2 Replies

  • Pbiuserr , create both TOPN on one measure. refer example , and calculate other measure on that

     

    example

     

    CALCULATE( [MTD Sales] ,TOPN(3,allselected('Table'[Category]),[MTD Sales],DESC),values('Table'[Category]))


    CALCULATE( [last MTD Sales] ,TOPN(3,allselected('Table'[Category]), [MTD Sales] ,DESC),values('Table'[Category]))