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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
pollyog
Advocate I
Advocate I

Comparing column values with measure

Hi there!

 

I have two tables (without relationship between them because of some businness rules). When I filter the CustomerID on table X, I have to check in every row of the table Y if this row is from this CustomerID. So, the first thing I've done was to create a measure in table Y as max(CustomerID), so the returned value is the clientID I'm filtering on table X. I need to do this:

 

Table X:

1º Filtered customer 123 in the CustomerID column

 

Table Y:

1º Create the measure M = max(CustomerID) that return to me the value 123

2º Now I have to create a table like this:

 

CustomerID   |  checkIfWasFilteredOnTableX

458                |               No

941                |               No

123                |               Yes

476                |               No

 

The problem is that I was not able to create a measure our column that I can use if(M = CustomerID, 'Yes', 'No') because it doesn't work! I've tried with Search function, Find function, Switch...but It does not work 😞

 

Anybody have some idea?

 

PS.: Unfortnately I can't use parameters because I will have to publish this on PBI Service and the end-user have to be able to filter the CustomerID.

 

Thankss!!

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @pollyog,

 

Based on my test, you should be able to use the formula below to create a measure, then show it with TableY[CustomerID] on the Table visual in your scenario. Smiley Happy

Measure = IF(MAX(TableY[CustomerID])=MAX(TableX[CustomerID]),"Yes","No")

r4.PNG

 

Regards

View solution in original post

3 REPLIES 3
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @pollyog,

 

Based on my test, you should be able to use the formula below to create a measure, then show it with TableY[CustomerID] on the Table visual in your scenario. Smiley Happy

Measure = IF(MAX(TableY[CustomerID])=MAX(TableX[CustomerID]),"Yes","No")

r4.PNG

 

Regards

Hi, thanks for the solution. I am having a similar problem but in my case I would like you use this measure as a filter/slicer. How can I do that? TIA

Thank you very much! It worked like a charm!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.