Forum Discussion

awalsh's avatar
awalsh
Helper I
5 years ago
Solved

Change Item Names In Legend from 2 Queries

Hi,    I need to change the item names in the legend of this pie chart.   However, the items in the legend are coming from 2 different queries, making it difficult for me to change their name. (T...
  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    5 years ago

    Hi, awalsh ;

    May be try to modify the measure as follows:

    new =
    VAR _relation =
        CALCULATE (
            MAX ( 'Table (2)'[Home] ),
            USERELATIONSHIP ( 'Table (2)'[ID], 'Table'[id] )
        )
    RETURN
        IF (
            [Living]
                IN { "BH", "DD", "SA" }
                && _relation = "Home",
            [Living],
            _relation
        )
    

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.