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! Learn more

Reply
JB_AT
Helper III
Helper III

Measure to Filter Visual

Hello

I am trying to filter a visual to show Employees who's birthday appears in the selected month in a slicer. I have the below measure which works partially, but only when the measure is added to the visual. i also have the measure set to Is 1 in the filter pane. I want to only add it to the Filter Pane of the visual and choose 1. But when I remove the measure from the visual everything returns blank. What Is missing here? I also want the measure to ignore any Year selected in the Year Slicer, that's why I have ALL(DIM_Date)

IF (
    HASONEVALUE ( DIM_Date[MonthNo] ),
    IF (
        MONTH (
            CALCULATE (
                MAX ( 'Employment'[DateofBirth] ),
                ALL ( DIM_Date ),
                USERELATIONSHIP ( 'DIM_Date'[Date], 'Employment'[DateofBirth] )
            )
        ) = SELECTEDVALUE ( DIM_Date[MonthNo] ),
        1,
        0
    ),
    BLANK ()
)

 
Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @JB_AT 

May I ask if this is the expected output you are looking for? Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.

vyaningymsft_0-1704448639772.png

 

vyaningymsft_1-1704448639772.png

 

Measures:

EmployeeBirthday =

VAR _selectedMonth =

    SELECTEDVALUE ( 'Month'[Month] )

VAR _EmpBirthdayMonth =

    CALCULATE (

        COUNTROWS ( Employment ),

        FILTER ( Employment, Employment[Birthday].[MonthNo] = _selectedMonth )

    )

RETURN

    IF ( ISFILTERED ( 'Month'[Month] ), _EmpBirthdayMonth, 1 )

 

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @JB_AT 

May I ask if this is the expected output you are looking for? Based on your description, I have created many measures to achieve the effect you are looking for. Following picture shows the effect of the display.

vyaningymsft_0-1704448639772.png

 

vyaningymsft_1-1704448639772.png

 

Measures:

EmployeeBirthday =

VAR _selectedMonth =

    SELECTEDVALUE ( 'Month'[Month] )

VAR _EmpBirthdayMonth =

    CALCULATE (

        COUNTROWS ( Employment ),

        FILTER ( Employment, Employment[Birthday].[MonthNo] = _selectedMonth )

    )

RETURN

    IF ( ISFILTERED ( 'Month'[Month] ), _EmpBirthdayMonth, 1 )

 

If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

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.