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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Filter visual based on another filter

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!

3 REPLIES 3
Anonymous
Not applicable

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/

amitchandak
Super User
Super User

@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))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

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"

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors