Forum Discussion

chiu2020's avatar
chiu2020
Frequent Visitor
3 years ago

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