Forum Discussion

datajunkie_29's avatar
1 year ago
Solved

DAX Measure: Incorrect Total of PBI vs Excel export

Hello Power BI Community,   I'm facing an issue with my DAX measure Budget Balance, where the totals in Power BI visual don't match when exported the results to Excel. The row-level calculations se...
  • datajunkie_29's avatar
    1 year ago

    Hello,
    I’ve found a solution that correctly calculates the Budget Balance total by using SUMMARIZE along with SUMX to iterate over the summarized table & ensure accurate aggregation.

    DAX Measure:

    VAR Result =
    SUMMARIZE(
    'Budgeted Suppliers',
    'Budgeted Suppliers'[BUDGETID],
    "SupplierBalance",
    IF([Total YTD Budget] = 0, [OpenAging] * -1, [Total YTD Budget] - SUM('Transaction Detail'[Participation/Received]))
    )
    
    RETURN
    SUMX(Result, [SupplierBalance])


    This approach prevents Power BI from applying the calculation at the total level incorrectly and ensures the sum of row-level results matches the expected total.

    Thank you! Heope this helps!