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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
GGergely
New Member

Compare field values to string works but compare to SelectedValue function does not

I have a table that contains countries.

There is another table with the same countries but used only to filter the first table, no relationship between them.

GGergely_4-1632921887694.png

 

Now I would like to create a new column which indicates if a country is being selected or not. It works fine when I specify the country name but it does not work when I use the SELCTEDVALUE function which gives the same country that I specified. 

GGergely_1-1632921690107.png

GGergely_2-1632921766822.png

SelectedCountry measure = SELECTEDVALUE(Country_Slicer[Select_a_Country])

 

I am confused. Can someone please explain why SELECTEDVALUE() --> Germany is not the same as "Germany"?

1 ACCEPTED SOLUTION
nandukrishnavs
Community Champion
Community Champion

@GGergely 

 

We can't pass filter selection to the calculated column. We have to create a DAX measure. 

IsSelected =
IF (
    SELECTEDVALUE ( Countries[Country] )
        = SELECTEDVALUE ( CountriesSlicer[Country] ),
    1,
    0
)

Regards,
Nandu Krishna

View solution in original post

2 REPLIES 2
nandukrishnavs
Community Champion
Community Champion

@GGergely 

 

We can't pass filter selection to the calculated column. We have to create a DAX measure. 

IsSelected =
IF (
    SELECTEDVALUE ( Countries[Country] )
        = SELECTEDVALUE ( CountriesSlicer[Country] ),
    1,
    0
)

Regards,
Nandu Krishna

Yep, that works, thank you for the help and also for saving my nerves.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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