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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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