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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Bug - Hasonvalue - Matrix

Dear All, 

I think I found a bug regarding the "HASONVALUE" calculation, so when there is only one element in a list, the hasonvalue can't work in a proper way. 

 

Capture.JPG

 

Could you please advise? 

 

Thank you so much, 

Máté

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

@Anonymous 

For what you're trying to do, since in the context of the matrix there is only one country within Arab States, HASONEVALUE ( Sheet1[Country] ) returns TRUE for both the Region and Country level.

 

You can use the ISINSCOPE function instead of HASONEVALUE and you should only see values at the country "level".

 

By the way, would you want to consider aggregating with SUM instead of SELECTEDVALUE? SELECTEDVALUE will return either the single value in the Summa column or blank if there are multiple values.

 

Regards,

Owen

 

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

3 REPLIES 3
OwenAuger
Super User
Super User

@Anonymous 

For what you're trying to do, since in the context of the matrix there is only one country within Arab States, HASONEVALUE ( Sheet1[Country] ) returns TRUE for both the Region and Country level.

 

You can use the ISINSCOPE function instead of HASONEVALUE and you should only see values at the country "level".

 

By the way, would you want to consider aggregating with SUM instead of SELECTEDVALUE? SELECTEDVALUE will return either the single value in the Summa column or blank if there are multiple values.

 

Regards,

Owen

 

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Hi Owen,

 

I also have a similar problem. 

this is the link to the problem. I tried your solution but it didnt help. Could you help me resolving this?

 

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Calculation-change-with-drill-down/m-p/994791...

 

Thanks in advance!

Anonymous
Not applicable

Dear Owen, 

This is why I love this community, it is a pleasure to work with clever people! 

 

Thank you for your recommendations, they helped me a lot.

 

All the best, 

Máté

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.