cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Calculating Inventory with Prepacked items

Hello,

My company sells its items in both prepackaged units and by individual pounds.

I am trying to do a calculation to find the real inventory in our warehouse (Prepack suffix of 50 is stored in our Inventory table as an each so 1) and its throwing me for a loop. I used the below method to get the right sum for the individual items broken out in a table, however the total comes out to be the sum of each UoM * quantity. The join goes Prepack table <- Item table -> Inventory table.

My calculation is as follows:  _Real QTY = if(ISBLANK(sum(DimPrepackUOM[WeightLBS])), sum(DimInventory[ActualQty]), sum(DimInventory[ActualQty]) * SUM(DimPrepackUOM[WeightLBS]))

Thanks

1 ACCEPTED SOLUTION
Community Support

Hi @JoeKat07 ,

We can try to use the following measuer to meet your requirement.

```_Real QTY =
IF (
ISINSCOPE ( DimInventory[IPC] ),
IF (
ISBLANK ( SUM ( DimPrepackUOM[WeightLBS] ) ),
SUM ( DimInventory[ActualQty] ),
SUM ( DimInventory[ActualQty] ) * SUM ( DimPrepackUOM[WeightLBS] )
),
SUMX (
SUMMARIZECOLUMNS (
'DimInventory'[IPC],
"qty", IF (
ISBLANK ( SUM ( DimPrepackUOM[WeightLBS] ) ),
SUM ( DimInventory[ActualQty] ),
SUM ( DimInventory[ActualQty] ) * SUM ( DimPrepackUOM[WeightLBS] )
)
),
[qty]
)
)```

BTW, pbix as attached.

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support

Hi @JoeKat07 ,

How about the result after you follow the suggestions mentioned in my original post?

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support

Hi @JoeKat07 ,

We can try to use the following measuer to meet your requirement.

```_Real QTY =
IF (
ISINSCOPE ( DimInventory[IPC] ),
IF (
ISBLANK ( SUM ( DimPrepackUOM[WeightLBS] ) ),
SUM ( DimInventory[ActualQty] ),
SUM ( DimInventory[ActualQty] ) * SUM ( DimPrepackUOM[WeightLBS] )
),
SUMX (
SUMMARIZECOLUMNS (
'DimInventory'[IPC],
"qty", IF (
ISBLANK ( SUM ( DimPrepackUOM[WeightLBS] ) ),
SUM ( DimInventory[ActualQty] ),
SUM ( DimInventory[ActualQty] ) * SUM ( DimPrepackUOM[WeightLBS] )
)
),
[qty]
)
)```

BTW, pbix as attached.

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors