Forum Discussion

RadaSTL's avatar
RadaSTL
Advocate I
8 years ago

RankX Measure Works Different on Different Visuals

Hello, I've read several topics here but nothing concrete or useful I could find. However there are several people that had the same issue, anyway here it goes:

 

I have 2 different ranking function, where I get the ranking for companies based on their sale amounts. While I have all the companies on a table, everything seems to be working fine, but when I pull one company on a card, the ranking usually slips, it is not only annoying but also very mysterious.... Is there something I miss? Or something I do wrong? Here are the measures I've written for this:

 

 

  • Satış Sıra (U):=RANKX(ALL(Firmalar[SFDistribütör]),CALCULATE([Aylık Kümülatif Satış (U)]),,DESC,Dense)
  • Aylık Kümülatif Satış (U):=CALCULATE([Satış (U)],DATESBETWEEN('Tarih Tablosu'[Tarih],DATE(YEAR([SelectedDate]),MONTH([SelectedDate]),1),[SelectedDate]),ALL('Tarih Tablosu'))
  • Satış (U):=IF(HASONEVALUE('Ölçüt'[ID]),SWITCH(VALUES('Ölçüt'[ID]),1,CALCULATE(SUM('ProdPack Daily'[Gross TL])),2,CALCULATE(SUM('ProdPack Daily'[Gross Pack])),3,CALCULATE(SUM('ProdPack Daily'[Net TL C])),4,CALCULATE(SUM('ProdPack Daily'[Net Pack]))),BLANK())
  • SelectedDate:=MIN(MAX('Tarih Tablosu'[Tarih]),MIN(CALCULATE(MAX('ProdPack Daily'[Date]),ALL('ProdPack Daily')),TODAY()))

 

1 Reply

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi RadaSTL,

     

    From below screenshot, you can see that the rank measure returns the same result in table visual and card visual.

     

    In your scenario, the context might be more complex that leads to different results in different visuals. Could you simplified the measure [Satış (U)] like below for a test? 

    • Satış (U):=CALCULATE(SUM('ProdPack Daily'[Gross Pack]))

    Regards,

    Yuliana Gu