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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Coffee
Advocate I
Advocate I

the Legend Interferes with 'Hasonefilter' and 'Isfiltered' DAX functions

Hi All,

 

Background: I am trying to utilize the 'Hasonefilter()' and 'Isfiltered' DAX function to keep my line chart from displaying data until one of two columns is filtered. I have been able to do this successfully if I do not have anything in the Legend.

 

My function looks like this: 

 

SiteSelectCheck_child = IF(or(ISFILTERED([MAD_Site]), HASONEFILTER('Hub/Child'[CHILD])),1,2)

 

Issue: In my line chart I want 'Child' to be the Legend. When I put 'Child' in the legend it counts as a filter with the Hasonefilter() and Isfiltered DAX functions. So the Isfiltered function will always be true, And the Hasonefilter function doesn't seem to be working as expected.

 

Some images of what I have right now with this function. I have been able to get 2/3 of the scenarios below with different functions, but never all 3 to work.

 

When nothing is filtered. The chart without a Legend doesn't show any data, but the chart with a Legend does show data (need this to not show data).

image.png

 

When I filter the Mad_Site. it successfully shows data in both.

 

image.png

When I filter the Child. It successfully filters only the child.

image.png

 

 

Conclusion: I can get all 3 of these scenarios if I take out the legend on my line chart, but then I'm not displaying all of the Child values.

 

Any help would be appreciated!

 

“Without my morning coffee I’m just like a dried up piece of roast goat.”

-Johann Sebastian Bach

 

2 REPLIES 2
Bhavesh22
New Member

Hello after 6 years, Got the same problem, did you find a workaround?
v-haibl-msft
Microsoft Employee
Microsoft Employee

@Coffee

 

The DAX functions are working as expected. Maybe we can use some other formulas to get the desired result.

Could you please provide some sample data of your table, or share your PBIX file through online file service like OneDrive?

 

Best Regards,
Herbert

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.