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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Anonymous
Not applicable

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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