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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors