Forum Discussion

akim_no's avatar
akim_no
Helper III
1 year ago
Solved

Price / Volume / Mix Effects Calculated at Row Level – Performance Optimization Help Needed

I'm working on a Price / Volume / Mix variance analysis where all effect calculations must be done at the most granular level (row by row), and then aggregated properly for totals in visuals (i.e. no...
  • v-veshwara-msft's avatar
    v-veshwara-msft
    1 year ago

    Hi akim_no ,

    Thanks for sharing the update.

    Noted that you're currently using SUMMARIZE for the conversion and it seems to be doing the job in your scenario. That’s good to hear.

     

    If ADDCOLUMNS is returning unexpected results, it’s worth double-checking two things:

    Ensure any calculated column inside ADDCOLUMNS (like Raw_Metric) is wrapped in CALCULATE, for example:

    "Raw_Metric", CALCULATE(SUM('Fact Table'[Raw_Metric]))
    This helps maintain the correct context for aggregation within each group.

     

    Also, check that the table you're passing to ADDCOLUMNS includes all the necessary columns to define the grouping. If any key column is missing, the results might not match due to changes in context.

     

    While SUMMARIZE can work in many scenarios, ADDCOLUMNS tends to preserve row context better, especially when dealing with calculations that depend on multiple dimensions or filter propagation.

     

    If you're still seeing performance issues or unexpected results, feel free to share a sample PBIX or a few rows of sample data.

     

    Hope this helps. Please reach out for further assistance.

    Thank you.