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
joshcomputer1
Helper V
Helper V

filter not changing based on page level filter

I have a month slicer pointing to Date[Monthshort] in my Date table. This shows the 3 letter month name.  It is currently showing all 12 months.  I am using a calculated column called "IsLastSixMonths" to determine if the date in Dataset[ContactDate] is in the last six months. This results to True/False and updates dynamically based on today's date.  I have this as a filter on the page visual, and everything else on the page is filtering correctly. How can I get my filter visual to only show the six month window?  

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@joshcomputer1,

In your scenario, create the calculated column in the Date table instead of the DataSet table, then drag the calculated column to page level filter, this way, the month slicer will be filtered correctly.

IsLastSixMonth1 = VAR MonthDiff = IF ( 'Date'[Date]<= TODAY (), - DATEDIFF ( 'Date'[Date], TODAY (), MONTH ), DATEDIFF ( TODAY (), 'Date'[Date], MONTH ) ) RETURN IF ( MonthDiff >= -6 && MonthDiff <= -1, TRUE () )  




Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

@joshcomputer1,

In your scenario, create the calculated column in the Date table instead of the DataSet table, then drag the calculated column to page level filter, this way, the month slicer will be filtered correctly.

IsLastSixMonth1 = VAR MonthDiff = IF ( 'Date'[Date]<= TODAY (), - DATEDIFF ( 'Date'[Date], TODAY (), MONTH ), DATEDIFF ( TODAY (), 'Date'[Date], MONTH ) ) RETURN IF ( MonthDiff >= -6 && MonthDiff <= -1, TRUE () )  




Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yuezhe-msft
Employee
Employee

@joshcomputer1,

I test the scenario as yours and can’t reproduce your issue. I create the calculated column using the DAX below, and put it to page level filter and set its value to True, the month slicer is filtered correctly.

IsLastSixMonths = 
VAR Datediff =
    1
        * ( 'Calendar'[DateKey] - TODAY () )
RETURN
    SWITCH (
        TRUE,
        AND ( Datediff <= 0, Datediff >= -180 ), TRUE(),
        Datediff < 180, FALSE()
    )


Would you please share your PBIX file for us to analyze? You can upload PBIX file to OneDrive, and send me the shared link of the PBIX file via Private message.

Regards,
Lydia


Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.