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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ndj2212
New Member

Comparing measure and column value

Hi all,

 

I'm new to PBI and struggling to understand why this if statement isn't working. 

I want to check whether the selected filter value is present in another table (linked via a separate key). 

 

In this example, the value ID 87308 is selected by a page filter, and appears in this table using the SELECTED VALUE function in column "sel". I want to compare sel to Node1, but for some reason the if statements I've tried in columns "matched" and "M2" don't recognise that two values are the same. The Sel field is a measure (I think it has to be given that I'm using the selectedvalue function), and the Node1 field is a calculated column. 

 

Any tips on how to get this to work? 

1000078650.jpg

Matched = if([sel]=[Node1], "Y", "N") only returns N values 

 

The two strings are identical, there isn't any whitespace. 

 

Many thanks! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the replies from Chetan007 and HotChilli.

 

Hi @ndj2212 ,

 

As HotChilli says, because calculated column are pre-calculated and stored, they do not react to dynamic changes in page filters or slicers. Calculated column remain the same no matter how you filter the data in your report.

 

So you should create a measure instead of a calculated column, for example:

Measure = IF(MAX([Node1])=[sel],"Y","N")

Result:

vlinhuizhmsft_0-1730360587798.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Thanks for the replies from Chetan007 and HotChilli.

 

Hi @ndj2212 ,

 

As HotChilli says, because calculated column are pre-calculated and stored, they do not react to dynamic changes in page filters or slicers. Calculated column remain the same no matter how you filter the data in your report.

 

So you should create a measure instead of a calculated column, for example:

Measure = IF(MAX([Node1])=[sel],"Y","N")

Result:

vlinhuizhmsft_0-1730360587798.png

Best Regards,
Zhu

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

HotChilli
Super User
Super User

This happens a lot. Calculated columns do not respond to slicers/filters.

HotChilli
Super User
Super User

'Matched' is a column or a measure?

matched is a column. I just need a text row-level column that is Y if the Node1 column matches the selected value ("sel") 

Chetan007
Frequent Visitor

Hii

 

Column = IF('Table'[a]=='Table'[b],"Yes","NO")
use == sign like this

Thanks for your help, unfortunately that doesn't make a difference 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors