Forum Discussion
Injecting a Dynamic Variable into an Analysis Services Query for Filtering Analysis Serv. Cube Data
- 1 year ago
Thanks for sharing the update. Since your report uses DirectQuery, you can make budget code filtering dynamic without hardcoding it in your DAX query.
1.Use a slicer linked to a budget codes table to filter the data dynamically.
2. If needed, set up Row-Level Security in SSAS to restrict data based on user selection.
For an advanced option, you can try Dynamic M Query Parameters. This lets you filter directly in Power Query with parameters. Just make sure the Dynamic M Query Parameters feature is enabled under Options → Preview Features, and it's properly linked to your budget codes.
FYI:
For more details, please refer to the following documentation.
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
Connect to Analysis Services data in Power BI Desktop - Power BI | Microsoft Learn
I hope this helps...
Hello leina_daniel ,
Thanks for posting your query in the Microsoft Fabric Community. The approach to dynamically filtering budget codes depends on your connection mode in Power BI
1. Dynamic M Query Parameters work only in DirectQuery mode.
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
2. Dynamic M Query Parameters are NOT supported Live Connection
Instead, use slicers linked to a budget codes table or configure RLS in SSAS for filtering.
Connect to Analysis Services data in Power BI Desktop - Power BI | Microsoft Learn
Thanks for your continuous inputs for the community lbendlin .
To provide the most accurate solution, could you confirm whether your report is using DirectQuery, or a Live Connection?
Regards,
Yugandhar.
The report uses a DirectQuery connection. Apologies for not clarifying sooner!
- V-yubandi-msft1 year agoCommunity Support
Thanks for sharing the update. Since your report uses DirectQuery, you can make budget code filtering dynamic without hardcoding it in your DAX query.
1.Use a slicer linked to a budget codes table to filter the data dynamically.
2. If needed, set up Row-Level Security in SSAS to restrict data based on user selection.
For an advanced option, you can try Dynamic M Query Parameters. This lets you filter directly in Power Query with parameters. Just make sure the Dynamic M Query Parameters feature is enabled under Options → Preview Features, and it's properly linked to your budget codes.
FYI:
For more details, please refer to the following documentation.
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
Connect to Analysis Services data in Power BI Desktop - Power BI | Microsoft Learn
I hope this helps...