Forum Discussion

Deelip's avatar
Deelip
Resolver I
1 year ago
Solved

Visual Calculations/ DAX Measure - Total Incorrect on Table Visual

Hi All, I am reaching out for help on DAX. I know this a common issue in this forum. I tried different approaches but none of them gets me to the solution. I tried to use visual calculations and swi...
  • rajendraongole1's avatar
    1 year ago

    Hi Deelip  - you should modify your measure using sumx on tht table.

     

    Availability_Corrected =
    SUMX(
    'product tbl',
    VAR _PO_QTY = CALCULATE(SUM('product tbl'[PO_Qty]))
    VAR _PREBOOK_QTY = CALCULATE(SUM('product tbl'[PreBookQty]))
    VAR _PLANTED_QTY =
    SUMX(
    FILTER('Dynamic', 'Dynamic'[plantState] = "Realized"),
    'Dynamic'[quantity]
    ) + CALCULATE(SUM(Overdue[quantity]))

    VAR _PLANNED_QTY =
    SUMX(
    FILTER('Dynamic', 'Dynamic'[planState] = "Budget"),
    'Dynamic'[quantity]
    ) + CALCULATE(SUM('External Bookings'[Booked Qty]))

    RETURN
    IF(
    NOT(ISBLANK(_PLANTED_QTY)),
    _PLANTED_QTY - _PO_QTY - _PREBOOK_QTY,
    _PLANNED_QTY - _PO_QTY - _PREBOOK_QTY
    )
    )

     

    try this in report and hope it works.