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
DC_ZA
New Member

SELECTEDVALUE returns blank in column but is populated when added to card

I have a table in PowerBI with a monthstring column (YYYYMM), I use this in a filter so the datatype is set as 'text', I created a measure using SELECTEDVALUE to return the monthstring that is selected in the filter. When I add this measure in a card, it returns the correct value and also changes as I change the selection.

 

X_SelectedMonthstring = SELECTEDVALUE(Dim_FilterMonthString[Monthstring])
 
The problem comes in when I want to use this measure in another column, say for instance to add a column with a flag (1 or 0) to indicate the selected monthstring in a table, it is only returning 1 for all fields.
 
Measure: X_SelectedMonthstring = SELECTEDVALUE(Dim_FilterMonthString[Monthstring])
 
Column: X_MonthString_Flag = IF(Dim_FilterMonthString[MonthString]=[X_SelectedMonthstring],1,0)
Column: X_TestString = SELECTEDVALUE(Dim_FilterMonthString[MonthString])
 
card.JPGtable.JPG
 
If I change the column formula to be a fixed value I get the desired results:
Column: X_MonthString_Flag = IF(Dim_FilterMonthString[MonthString]="202106",1,0)table2.JPG
1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@DC_ZA 

i don't think the slicer can affect a calculated column. You need to have a measure solution





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@DC_ZA 

i don't think the slicer can affect a calculated column. You need to have a measure solution





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu Thank you, I skipped using the flag column all together and used my measure directly in my second measure and it worked. 

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.