Forum Discussion

karimm's avatar
karimm
Helper III
10 months ago
Solved

Calculation groups to replace slow IF/SWITCH?

Hi All   I would appreciate your help to understand whether this idea suggested by genAI is true or a hallucination.   I have a report in which the main page has many KPIs and 2 modes related to ...
  • v-hashadapu's avatar
    v-hashadapu
    9 months ago

    Hi karimm , Thank you for reaching out to the Microsoft Fabric Community Forum.

     

    You’re right, even when Preset is selected, Power BI’s query engine still ends up touching the expressions behind the slow measure, so you don’t get the fast-only path. Field parameters and calculation groups change how you organize/switch measures, not how the DAX engine chooses what to evaluate, so they won’t reliably prevent the other branch from being computed.

     

    The reason your bookmark setup performs best is simple: bookmarks physically hide the visuals that reference the heavy measures. When visuals aren’t rendered, Power BI doesn’t query their measures at all, meaning only the fast queries run. That’s why you’re seeing consistent, predictable performance there.

     

    If you want to remove bookmark maintenance while keeping the same speed, the only real fix is at the model level. Build a pre-aggregated table for your preset date ranges and configure Manage Aggregations (or a composite model). That way, Power BI automatically routes preset queries to the aggregated table and only uses raw data for true custom ranges, no branching logic or bookmarks needed.

     

    Create calculation groups in Power BI - Power BI | Microsoft Learn

    Calculation groups in Analysis Services tabular models | Microsoft Learn

    User-defined aggregations - Power BI | Microsoft Learn

    Use report readers to change visuals - Power BI | Microsoft Learn