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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Oliya
Frequent Visitor

Need help with the slicer filtering

https://drive.google.com/file/d/1kFf_Q2wl4FEWnABUJNpIX741SOf78iPP/view?usp=share_link

Ths is the sample file. I have a date slicer and a reference date slicers on the basis of which I am calculating change% compared to reference period.
Suppose I have only data of Jan month for 2022 then in the reference period while comparing it with year 2021 they should only see jan in the year 2021 and not all months in the reference slicer. How I can achieve this?

 

Oliya_0-1682022038238.png

 

 

2 REPLIES 2
Oliya
Frequent Visitor

Thanks for the solution. But this not working at Qtr level how I can apply the logic as Qtr level?

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1682024715387.png

 

 

reference date visual filter: =
VAR _selectedyear =
    MAX ( 'Date'[Year] )
VAR _selectedmonth =
    MAX ( 'Date'[MonthNo] )
RETURN
    COUNTROWS (
        FILTER (
            'Reference Date',
            'Reference Date'[Year] = _selectedyear - 1
                && 'Reference Date'[MonthNo] = _selectedmonth
        )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.