Forum Discussion

sahooak's avatar
sahooak
Frequent Visitor
8 months ago
Solved

How to replicate a tableau Calculation in Power BI

hello Everyone, I need help with this. I need to replicate one Tableau Calculation into DAX I have this below tableau calucation IF [Order Day Number] < [CurrentDayNumber] THEN { SUM([Ship Am...
  • amitchandak's avatar
    8 months ago

    @sahooak , try one of the two

    CALCULATE(
    [Ship Amt CQ Pull In] ,
    allexcept('Data', 'Data'[Product] ), 'Data'[Product] = "Chair"
    )

    or

    CALCULATE(
    sumx(filter('Data'), 'Data'[Product] = "Chair"), [Ship Amt CQ Pull In] ,
    allexcept('Data', 'Data'[Product] )
    )

  • v-dineshya's avatar
    8 months ago

    Hi sahooak ,

    Thank you for reaching out to the Microsoft Community Forum.

     

    Please refer below DAX measure.

     

    Ship Amt CQ Pull In LOD =
    VAR FilteredTable =
    FILTER(
    ALL('Data'),
    'Data'[Product] = "Chair"
    && 'Data'[Order Day Number] < 'Data'[CurrentDayNumber]
    )
    RETURN
    CALCULATE(
    [Ship Amt CQ Pull In],
    FilteredTable
    )

     

    Please refer below DAX measure without variables.

     

    Ship Amt CQ Pull In LOD =
    CALCULATE(
    [Ship Amt CQ Pull In],
    ALL('Data'),
    'Data'[Product] = "Chair",
    'Data'[Order Day Number] < 'Data'[CurrentDayNumber]
    )

     

    I hope this information helps. Please do let us know if you have any further queries.

     

    Regards,

    Dinesh