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
svsivaraju
Frequent Visitor

year and moth filter

when we choose the year 2023 in filter and month of july in month filter then the data should apper from jan-june in the visual and other example when we choose the year 2023 in filter and month of april in month filter then the data should apper from jan-march in the visual

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @svsivaraju ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create a measure.

Measure =
VAR _year =
    SELECTEDVALUE ( 'year'[year] )
VAR _month =
    SELECTEDVALUE ( 'month'[month] )
VAR _tableyear =
    YEAR ( MAX ( 'Table'[date] ) )
VAR _tablemonth =
    MONTH ( MAX ( 'Table'[date] ) )
VAR _re =
    IF (
        _year <> BLANK ()
            && _month = BLANK ()
            && _year = _tableyear,
        1,
        IF (
            _year <> BLANK ()
                && _month <> BLANK ()
                && _year = _tableyear
                && _month > _tablemonth,
            1,
            BLANK ()
        )
    )
RETURN
    _re

vrongtiepmsft_2-1695866471747.png

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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