Forum Discussion

JustinDoh1's avatar
JustinDoh1
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

Aggregate a column to join two columns (two tables)

I have been struggling with this DAX code for last couple of hours, and I decided to ask for help. I am sharing my Pbix file here in Google drive. What I am tyring to get is, or expected outp...
  • Stachu's avatar
    5 years ago

    Main and Index tables have many:many relationship, so you have to force filter context of one to the other, you can do that with TREATAS:

    IR =
    SWITCH (
        MAX ( Main[MainRating] ),
        1, "*",
        CALCULATE (
            MAX ( Index[IndexPoint] ),
            TREATAS ( VALUES ( Main[MainRating] ), 'Index'[IndexRating] )
        )
    )