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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.