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.
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 Forecast | Work Day Indicator |
100 | 0 |
250 | 1 |
I tried this with no luck.
GSF New =
CALCULATE (
SUM ( 'BU Performance - Daily'[Gross Sales Forecast] ),
ALL ( 'Date'[Workday Indicator] )
)
Thanks,
Ritesh
Solved! Go to 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.
@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.
I should mention, On the X axis, we have "Executive Segment". A and B.
This is with Work Indicator being 0 coming as 145M
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |