Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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:
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.
Solved! Go to Solution.
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.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |