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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SDVN
Helper I
Helper I

Issue with HASONEVALUE.

Hi,

 

Am new to Power BI. I am having really tough time understaing some DAX functions like HASONEVALUE. 

I am attempting to use this function like below:

 

SDVN_0-1634070090499.png

I have choosed 2 location and still I can see the Bar graph but the card shows zero. Why is it not working for the bar graph? My understanding is that, if you choose 2 options in slicer, essentially it should not work. Please suggest. My DAX is:

Hasonevalue 1 = IF(HASONEVALUE(data[Location]), SUM(data[Sales Amount]),0)
 
SDVN_1-1634070267149.png

 

Regards,

Sid

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

when you selected two locations, in the filter context of card visual there are two values then it got a zero.

but in the bar visual, each bar represents one location, so it always has one value.

View solution in original post

1 REPLY 1
wdx223_Daniel
Super User
Super User

when you selected two locations, in the filter context of card visual there are two values then it got a zero.

but in the bar visual, each bar represents one location, so it always has one value.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

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.