Forum Discussion

PowerBITestingG's avatar
PowerBITestingG
Icon for Resolver I rankResolver I
3 years ago
Solved

Replicate self join with measure

I have a report with a live connection to a model.

 

I have the following table:

CountryCodeMessage
USA999All is well
Canada999Error today

 

 

And I want to create another column that only contains the messaged for Canada-Code

CountryCodeMessageMessage Canada
USA999All is wellError today
USA999All is wellError today

 

Any idea of how to do that only using a measure? What I was doing before was loading a new table with just the data for Canada and then joining to the original table.

 

  •  

    Ok I have solved it

     

    Canada Message =
    var selec = SELECTEDVALUE(Code)

    return
    CALCULATE(max(message),FILTER(all(message table),Country="Canada" && Code=selec))

1 Reply

  •  

    Ok I have solved it

     

    Canada Message =
    var selec = SELECTEDVALUE(Code)

    return
    CALCULATE(max(message),FILTER(all(message table),Country="Canada" && Code=selec))