Forum Discussion
How to replicate a tableau Calculation in Power BI
- 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] )
) - 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
TotalShip_Chair_CQ_PullIn =
CALCULATE(
SUM('Data'[Ship Amt]),
'Data'[Product] = "Chair",
'Data'[PullInFlag] = "Y",
'Data'[Current Fiscal Quarter] = 0,
FILTER(
ALL('Data'),
'Data'[Order Day Number] < 'Data'[CurrentDayNumber]
)
)
Try the above.
If this helps, please mark it as a solution and give kudos π
Thank you for you reply. Your DAX is giving same values in each row.
this condition should work first