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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.