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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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