Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have a date filter for the current and last month and a couple of visuals that display data. For one of these visuals I want to make a change so that when there is a filter on "Current month" it actually shows this month data and last day of the previous month. I have flags created on Calendar table for this. My measure:
Test =
IF (
SELECTEDVALUE ( 'Calendar'[Filter date] ) = "Current month",
CALCULATE (
[Portfolio],
FILTER (
'Calendar',
'Calendar'[Current month + last day filter] = "Current month + last day"
)
),
CALCULATE (
[Portfolio],
FILTER (
'Calendar',
'Calendar'[Current month + last day filter] = "Last month"
)
)
)
It doesn't work even after disabling filtering of filter on the visual. Any ideas?
Thanks a lot!
Found the solution. You have to create a dummy calendar table and then use @amitchandak measure. Example of how it works is here: https://dax.tips/2020/02/05/overriding-slicers/
@Anonymous , Hope the two values are not overlapping in Current month + last day
and if the calendar is joined then it should automatically filter. But as there over lapping try like
measure =
var _max = if( SELECTEDVALUE ( 'Filter'[Filter date] ) = "Current month" , eomonth(Today,0),
eomonth(Today,-1) )
var _min = if( SELECTEDVALUE ( 'Filter'[Filter date] ) = "Current month" , eomonth(Today,-1),
eomonth(Today,-2)+1 )
return
calculate( sum(Table[Value]), filter('Calendar', 'Calendar'[Date] >=_min && 'Calendar'[Date] <=_max))
Unfortunetly it doesn't work. When I have filtering turned off and I change filter from "Current month" to "Previous month" nothing is changing. When I have filtering turned on than it overrides everything and I see only either "Current month" or "Previous month"
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.