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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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