Forum Discussion

cjcj's avatar
cjcj
Helper I
3 years ago

Rankx multiple tables

Hi, I have a table visualization pulling in data from multiple connected tables and a measure and I am seeing unexpected results when adding a rankx measure.

 

RANKX (
ALLSELECTED ('MeasureTableX'),
CALCULATE (
[Sales],
ALLEXCEPT(Table1, Table1[ID]),
ALLEXCEPT(Table2, Table2[Location]),
ALLEXCEPT(Table3, Table3[Product]))
,,DESC
)

 

 

any thoughts would be appreciated.

4 Replies

    • bcdobbs's avatar
      bcdobbs
      Community Champion

      How are the tables related. Can you describe MeasureTableX? I suspect that might be causing the issue as you really want to rank over a table at the same grain as your visual.

      • cjcj's avatar
        cjcj
        Helper I

        Hi, MeasureTableX is just a table of measures...so not really a table.  Not sure if rankx syntax would take a table of measures vs an actual table. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi cjcj,

    Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

    How to Get Your Question Answered Quickly  

    Regards,

    Xiaoxin Sheng