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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

HASONEFILTER in DAX??

Can someone tell me what Exactly is HASONEFILTER() does in DAX? I know I can search in internet and learn from there which i tried but this function does not seem to be going in my head?

Can anyone explain this DAX f(x) with some demo example.

 

Regards,

Droid

1 ACCEPTED SOLUTION

Hi @Anonymous

Here 'Filter' are we referring to any type of filter whether it be a visual level filter, page level filter, report level or even a slicer.

Look at my test

add the following measure in a card visual without any filter

filter = IF(HASONEFILTER(Sheet3[stage name]),TRUE(),FALSE())

2.png

Then add a visual level filter and select an item

4.png

Then add a slicer and select an item

3.png

 

 

Best Regards

maggie

View solution in original post

4 REPLIES 4
Stachu
Community Champion
Community Champion

quoting https://msdn.microsoft.com/en-us/query-bi/dax/hasonefilter-function-dax

Remarks

  1. This function is similar to HASONEVALUE() with the difference that HASONEVALUE() works based on cross-filters while HASONEFILTER() works by a direct filter.


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

H @Anonymous

 

Say for example, country table has 2 filters applied, Category table has one filter applied, Sales table has no filter. Then

 

HASONEFILTER(Country) returns FALSE

HASONEFILTER(Category) returns TRUE

HASONEFILTER(Sales) returns FALSE

 

Which means , if the table/column has only one filter , then this function returns true. Hope this helps.

 

Thanks

Raj

Anonymous
Not applicable

Here by 'Filter', are we referring to any type of filter whether it be a visual level filter, page level filter, report level or even a slicer?

Or do we have any other type of filteration ?

Hi @Anonymous

Here 'Filter' are we referring to any type of filter whether it be a visual level filter, page level filter, report level or even a slicer.

Look at my test

add the following measure in a card visual without any filter

filter = IF(HASONEFILTER(Sheet3[stage name]),TRUE(),FALSE())

2.png

Then add a visual level filter and select an item

4.png

Then add a slicer and select an item

3.png

 

 

Best Regards

maggie

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.