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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
jtpiazzamn
Helper I
Helper I

Measure not returning a value

I have a measure using SWITCH but its not returning a value. So I simplified it and its still not working. The strange thing is I have the same measure on a different PowerBI file and it works fine. 
 
Whats wrong with the following measure - its not returning any value for DimValue1 ?
 
Net Value1 =
VAR DimName1 = SELECTEDVALUE('Suggestion Rating'[Suggestion Rating.ratingDimension.name])
VAR DimValue1 = SELECTEDVALUE('Suggestion Rating'[Suggestion Rating.value])
RETURN
DimValue1
 
Thanks in advance. 
Jim
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jtpiazzamn ,

 

I made an example for your reference.

vstephenmsft_0-1692863854918.png

As you can see, the SELECTEDVALUE function returns blank. Because the SELECTEDVALUE function returns the value when the context for columnName has been filtered down to one distinct value only.

If you select an ID in the slicer, the measure in the card visual returns value. 

vstephenmsft_1-1692863937980.png

If the slicer doesn't select it, you put the measure into a visual with context, and the measure returns value.vstephenmsft_2-1692863950348.png

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @jtpiazzamn ,

 

I made an example for your reference.

vstephenmsft_0-1692863854918.png

As you can see, the SELECTEDVALUE function returns blank. Because the SELECTEDVALUE function returns the value when the context for columnName has been filtered down to one distinct value only.

If you select an ID in the slicer, the measure in the card visual returns value. 

vstephenmsft_1-1692863937980.png

If the slicer doesn't select it, you put the measure into a visual with context, and the measure returns value.vstephenmsft_2-1692863950348.png

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

 

Sergii24
Super User
Super User

Hi @jtpiazzamn,

 

Your variable "DimValue1" is using a tricky function - SELECTEDVALUE(). In case multiple values are provided, its result is Blank() (you can learn more about it here - SELECTEDVALUE – DAX Guide).

 

The first thing I suggest is to test an alternative result and make sure that it's not a case that on a visual, where you use Net Value1, for some row SELECTEDVALUE() of DimValue1 is returning this alternative result.

 

If not, some more details on 'Suggestion Rating' table, [Suggestion Rating.value] column and the visual where you use Net Value1 might be required.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.