Forum Discussion

SDVN's avatar
SDVN
Helper I
4 years ago
Solved

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:

 

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)
 

 

Regards,

Sid

  • 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.

1 Reply

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion

    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.