Forum Discussion

IMRGZ's avatar
IMRGZ
Icon for Helper I rankHelper I
5 years ago
Solved

Create either/or (conditional) relationships in Power BI

Hi all, I have some difficulties explaining what I want to do, since it is not something I work with on a regular basis, but I made a visual representation of what I'm trying to do: I want to...
  • Greg_Deckler's avatar
    Greg_Deckler
    5 years ago

    IMRGZ I cannot fathom why the result table is the same as LookupTable2. If  you have LookupTable2 and LookupTable2 is what you want, then why not just use LookupTable2? In any case, still not understanding what you are going for, I did this:

    Table = 
        FILTER(
            ADDCOLUMNS(
                'Fact table',
                "feature",
                IF(
                    NOT(ISBLANK(MAXX(FILTER('Lookup Table2','Lookup Table2'[ID3]=[ID1]),[feature]))),
                    MAXX(FILTER('Lookup Table2','Lookup Table2'[ID3]=[ID1]),[feature]),
                    MAXX(FILTER('Lookup Table2','Lookup Table2'[ID4]=[ID1]),[feature])
                )
            ),
            NOT(ISBLANK([feature]))
        )