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
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
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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.