Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How to Calculate Total after using Parameters

Hi all,

 

I got below report and cannot calculate a correct grand total.

Some logic for calculation

- Density is anumeric parameter

- Each Warehouse has own Density Value

- CuFt =  SqFt * Density

 

I am using below DAX for calculating CuFt for each warehouse, but I cannot get the correct total (just place an text for remind).

Can anyone help and any other solution?

 

DAX Code

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 EOSCA=if(SELECTEDVALUE(Warehouse[Warehouse])="EOSCA",'WH Capacity Measurement'[WH CuFt Capacity]*'Density - EOSCA'[Density - EOSCA Value],0)
VAR EOSTX=if(SELECTEDVALUE(Warehouse[Warehouse])="EOSTX",'WH Capacity Measurement'[WH CuFt Capacity]*'Density - EOSTX'[Density - EOSTX Value],0)
VAR Irvine=if(SELECTEDVALUE(Warehouse[Warehouse])="Irvine",'WH Capacity Measurement'[WH CuFt Capacity]*'Density - Irvine'[Density - Irvine Value],0)

Return


if(SELECTEDVALUE(Warehouse[Warehouse])="GSW",GSW,
if(SELECTEDVALUE(Warehouse[Warehouse])="Oneill GA",Oneill,
if(SELECTEDVALUE(Warehouse[Warehouse])="EOSCA",EOSCA,
if(SELECTEDVALUE(Warehouse[Warehouse])="EOSTX",EOSTX,
if(SELECTEDVALUE(Warehouse[Warehouse])="Irvine",Irvine,
"Depend Density")))))

chiu2003_0-1687259337533.png

 

3 REPLIES 3
devanshi
Helper V
Helper V

Capacity (CuFt) =
VAR
  capacity if(SELECTEDVALUE(Warehouse[Warehouse]),'WH Capacity Measurement'[WH CuFt Capacity]*'Density - Irvine'[Density - Irvine Value]0)
Return
if(SELECTEDVALUE(Warehouse[Warehouse]),(Warehouse[Warehouse]),
"Depend Density")
Anonymous
Not applicable

Hi, thanks for your help.

 

But I would like to return 1,179,800 (570,000+ 380,800+102,000+102,000+25,000) instead of Depend Density for Table total 

You can sum the value of that column instead of depend density.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.