Forum Discussion
chiu2020
3 years agoFrequent Visitor
Incorrect Total after what-if parameter
Hi all,
I am building below matrix and need to convert the SqFt to Capacity (CufT) (SqFt * Density).
As 2 warehouses have different Density, and I write below DAX.
However, I still cannot figure out how to get the correct total capacity.
Can anyone help? Thanks.
Capacity (CuFt) =
VAR GSW=if(SELECTEDVALUE(Warehouse[Warehouse])="GSW",'WH Capacity Measurement'[WH CuFt Capacity]*'Density - GSW'[Density - GSW Value],0)
VAR Oneill=if(SELECTEDVALUE(Warehouse[Warehouse])="Oneill GA",'WH Capacity Measurement'[WH CuFt Capacity]*'Density - ONLGA2'[Density - ONLGA2 Value],0)
VAR Total=GSW+Oneill
Return
if(SELECTEDVALUE(Warehouse[Warehouse])="GSW",GSW,if(SELECTEDVALUE(Warehouse[Warehouse])="Oneill GA",Oneill,Total))
2 Replies
- HoangHugoSolution Specialist
hi, it should be
ReturnSUMX(SUMMARIZE([Warehouse]),if(SELECTEDVALUE(Warehouse[Warehouse])="GSW",GSW,if(SELECTEDVALUE(Warehouse[Warehouse])="Oneill GA",Oneill,blank())))- chiu2020Frequent Visitor
Hi.
Thanks for your reply, but i cannot modify the DAX and it is showing error
I have uploaded a demo PBI file. Thanks.
https://drive.google.com/file/d/1w3jwbXEBFTieszKYZl4Z6PG_3zqVf93w/view?usp=sharing