Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
PowerBITestingG
Resolver I
Resolver I

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.

 

1 ACCEPTED SOLUTION
PowerBITestingG
Resolver I
Resolver I

 

Ok I have solved it

 

Canada Message =
var selec = SELECTEDVALUE(Code)

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

View solution in original post

1 REPLY 1
PowerBITestingG
Resolver I
Resolver I

 

Ok I have solved it

 

Canada Message =
var selec = SELECTEDVALUE(Code)

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

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.