Forum Discussion

peterpure's avatar
peterpure
Regular Visitor
1 year ago
Solved

Need help with Two Date Filter Contexts on Same Page

I have a factSales table and a date dimension table in my model. I have given two kinds of slicers - A. dropdown of Month Year B. Disconnected Table slicer of MTD, QTD and YTD. My objective is to sho...
  • v-sgandrathi's avatar
    v-sgandrathi
    1 year ago

    Hi peterpure,

    Thank you for your thoughtful follow-up and for considering the suggestions from Community members.

     

    When you place Month Year on the X-axis, it takes filter context directly from your slicer, which limits the visual to only the selected month. This setup conflicts with the goal of showing multiple periods like MTD, QTD, or YTD for Month-on-Month comparisons.

    To address this, you can use a disconnected Month-Year table. This lets users make selections without filtering your Fact table directly. In these cases, create measures that read the selected period (MTD/QTD/YTD) from the disconnected slicer using SELECTEDVALUE, and apply custom filtering in your DAX measures with CALCULATE and REMOVEFILTERS or ALL. These functions help override slicer filters, enabling accurate period-over-period analysis across the full time axis. This way, you can display Month-on-Month growth metrics while maintaining the chosen aggregation level.

    Regarding performance, using SUMX directly on a column can be more efficient for simple aggregations, but when you need to manipulate context, CALCULATE is necessary. For better performance, use variables (VAR) for intermediate calculations, avoid unnecessary context transitions, and use tools like Performance Analyzer in Power BI Desktop to test and optimize your model.

    Thank you.