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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ritesh_Air
Post Patron
Post Patron

A DAX measure to ignore specific Filter.

Hi,

 

I am trying to ignore a filter in a visual. Here is the problem statement:

 

I have a measure called "Gross Sales Forecast" and filter called "Workday Indicator", which filters weekend dates.
In my visual, I want to ignore this filter for just this one measure. There are other measures in the visuals as well, they should work as expected.


So for e.g.: even if the filter of Workday Indicator being 1, "Gross Sales Forecast" should show 350.

Gross Sales ForecastWork Day Indicator
1000
2501

 

I tried this with no luck.

 

 

GSF New =
CALCULATE (
    SUM ( 'BU Performance - Daily'[Gross Sales Forecast] ),
    ALL ( 'Date'[Workday Indicator] )
)

 

 

Thanks,

Ritesh

 

@parry2k 

@mahoneypat 

1 ACCEPTED SOLUTION

@Ritesh_Air , That all workday might not work.  Try like, this will ignore workday filter but add date filter

GSF New =
var _min = minx(allselected('Date'),'Date'[Date])
var _min1 = minx(allselected('Date'),'Date'[Date])
CALCULATE (
    SUM ( 'BU Performance - Daily'[Gross Sales Forecast] ),
     filter(all(Date),Date[Date]<=_max && Date[Date]>=_min)
)

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Ritesh_Air what you currently doing is not working? 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 

 

I should mention, On the X axis, we have "Executive Segment". A and B.

 

This is with Work Indicator being 0 coming as 145M

 

Ignore.PNG

 

I was hoping it to be aggregation of both Work Indicator 0 and 1. 

 

I have tried this as well to test. This ignores Executive Segment, but I don't want to ignore "Executive Segment". Only want to ignore "Workday Indicator"

GSF New =
CALCULATE (
    SUM ( 'BU Performance - Daily'[Gross Sales Forecast] ),
    ALL ( 'Date'[Workday Indicator] ),
    ALL ( 'Product'[Executive Segment] )
)

 

Thanks,

Ritesh

 

 

@Ritesh_Air , That all workday might not work.  Try like, this will ignore workday filter but add date filter

GSF New =
var _min = minx(allselected('Date'),'Date'[Date])
var _min1 = minx(allselected('Date'),'Date'[Date])
CALCULATE (
    SUM ( 'BU Performance - Daily'[Gross Sales Forecast] ),
     filter(all(Date),Date[Date]<=_max && Date[Date]>=_min)
)

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Thanks Amit. It worked.

 

@amitchandakIf I have to document what that piece of code is doing then can you verbose it?

 

Thanks,

Ritesh

@Ritesh_Air , we are removing all the date filter by using all on date table and pushing back required filters

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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