Forum Discussion
DAX function / filter context issue
- 6 years ago
I was just able to actually solve this:
-I created a new table (basically duplicating one of my queries)
-Added a column calculating the values that I need (you have to adapt it since it is not a measure of course, like removing aggregators and replacing them with the actual columns in your table)
Now I created a measure which should be displayed in my visual.
e.g. CALCULATE ( SUM ('table'[Value))
I used REMOVEFILTERS to get rid of the slicer selection (this selection forced me to stay within the quarter which the user selected)
And now I could use DATESBETWEEN('Dates'[Date] , FIRSTDATE('Table'[Date]) , LASTDATE('Dates'[Date] )
to actually get the time period that I wanted to look at, in my visual.
Now whatever quarter the user selects will be the last data point on my visual.
If someone has a similar problem and my solution is not clear, please pm me
gbrunnerbi , you using the date filter from the date where you are trying to remove, that is what I understood.
Try filter like
filter(all(Date), Dates[Date]>=[FirstDateMeasure] && Dates[Date]<= [LastDateMeasure] )
Or use another date to filter
Check https://www.youtube.com/watch?v=duMSovyosXE
Please Watch/Like/Share My webinar on Time Intelligence: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184
My Youtube Tips at: https://www.youtube.com/playlist?list=PLPaNVDMhUXGYrm5rm6ME6rjzKGSvT9Jmy
Appreciate your Kudos.
Thanks but if I use your formula I get the wrong amounts, it is not summing up the values correctly
I think there is an inherent difference between FILTER and DATESBETWEEN
I am trying something like using ALL(DATE) as the table for my DATESBETWEEN function which does not work though I think?
I want to break out of the filter context within the measure (like with removefilters) and then still being able to use DATESBETWEEN but that is not possible so far?