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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors