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! Request now

Reply
anushkavp27
Frequent Visitor

Save filter and use to calculate measure

I have a power BI dashboard with a bunch of filters. I was wondering if there is a way to save the values of a filter and then use it in another calculated measure. 

For example, I have the following filter on my dashboard:

anushkavp27_0-1711380463876.png

And say, the user has filtered for the 3 months as shown above - 2024M03, 2024M04, 2024M05

 

And then I am hoping to use the saved filter in the below measure here:

GreaterTotals =
VAR a =
    SUMMARIZE (
        ALLSELECTED ( fiscal_calendar ),
        [fiscal_month],
        [fiscal_quarter]
    )
VAR b =
    ADDCOLUMNS (
        CROSSJOIN ( ALLSELECTED ( 'Part table'[part_nbr]), a ),
        "Groupby",
            [part_nbr] & " " & [fiscal_quarter],
        "Greats", [Greater?]
    )
VAR c =
    SELECTEDVALUE ( 'Part Table'[part_nbr] ) & " "
        & SELECTEDVALUE ( fiscal_calendar[fiscal_quarter] )
RETURN
    SUMX (
        FILTER ( b, [part_nbr] IN VALUES ( 'Part Table'[part_nbr] ) && [Groupby] = c ),
        [Greats]
    )

Hoping to replace the group-by from the fiscal_quarter to the above calculated measure (that is the saved filter that the user selects) rather than the fiscal quarter mentioned. So, it should be something like:

VAR b =
    ADDCOLUMNS (
        CROSSJOIN ( ALLSELECTED ( 'Part table'[part_nbr]), a ),
        "Groupby",
            [part_nbr] & " " & [user_selected_filter_month],
        "Greats", [Greater?]
    )

 

Please let me know if saving a filter this way is possible.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @anushkavp27 ,

@amitchandak  is Right , so i want to give other solution:

Power BI does not directly allow for "saving" filter selections in a way that they can be directly referenced within DAX formulas as variables.

You're already on the right track with using in your measure. To dynamically use the user-selected months in your calculations, ensure that your slicer or filter is correctly set up to allow users to select the months.

VAR b = 
    ADDCOLUMNS (
        CROSSJOIN ( ALLSELECTED ( 'Part table'[part_nbr] ), a ),
        "Groupby",
            [part_nbr] & " " & SELECTEDVALUE(fiscal_calendar[fiscal_month]),
        "Greats", [Greater?]
    )

Best Regards,

Xianda Tang

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @anushkavp27 ,

@amitchandak  is Right , so i want to give other solution:

Power BI does not directly allow for "saving" filter selections in a way that they can be directly referenced within DAX formulas as variables.

You're already on the right track with using in your measure. To dynamically use the user-selected months in your calculations, ensure that your slicer or filter is correctly set up to allow users to select the months.

VAR b = 
    ADDCOLUMNS (
        CROSSJOIN ( ALLSELECTED ( 'Part table'[part_nbr] ), a ),
        "Groupby",
            [part_nbr] & " " & SELECTEDVALUE(fiscal_calendar[fiscal_month]),
        "Greats", [Greater?]
    )

Best Regards,

Xianda Tang

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

okay, this helped. Thank you for pointing me in the right direction. I was able to use the SELECTEDVALUE() function and modify my DAX to get my use case working.
amitchandak
Super User
Super User

@anushkavp27 , No, Slicer values can only be used by a measure

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.

Top Solution Authors
Top Kudoed Authors