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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.