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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Atinder
Helper III
Helper III

Find On hand qty by a Unit of measure from two different table.

Hello, 

I am trying  o build a report or table  where i can find what is my on hand qty by Unit of measure from these 2 tables.
Table 1 pulls data from the BC item ledger.
Table 2 pulls data from the shopify. 

Table 1:  is my Remaning qty from BC by Unit of measure. 

Item NoUnit of measureQty Per UOMON HAND Qty
Blue-0012PK220
Blue-0012PK210
Blue-0012PK210
Blue-0012PK218
Blue-0012PK222
Blue-0012PK226
Blue-0012PK230
Blue-0013PK310
Blue-0013PK310
Blue-0013PK315
Blue-0013PK319
Blue-0013PK323
Blue-0013PK327
Blue-0013PK331
Blue-0014PK425
Blue-0014PK412
Blue-0014PK420
Blue-0014PK420
Blue-0014PK424
Blue-0014PK428
Blue-0014PK432
Blue-001Display810
Blue-001Display815
Blue-001Display815
Blue-001Display821
Blue-001Display825
Blue-001Display829

 

Table 2 - on hand qty by sales channel sku. 

Channel SKUSales Channel CodeQty Per UOMBC  item  numberon Hand Qty
BLUE-001 2PKShopify2Blue-001100
BLUE-001 3PKShopify3Blue-001120
BLUE-001 4PKShopify4Blue-001200
BLUE-001 DisplayShopify8Blue-001150


Here is what i am trying to get 

Channel SkuQty Per UOM Shopify On handBC on handVarraince ( Shopify - bc)
BLUE-001 2PK2100136-36
BLUE-001 3PK3120135-15
BLUE-001 4PK420016139
BLUE-001 Display815011535
1 ACCEPTED SOLUTION
v-kaiyue-msft
Community Support
Community Support

Hi @Atinder ,

1. Create a measure value and calculate the Item ledger total.

Measure =
CALCULATE(SUM('Item Ledger'[On Hand Qty]),FILTER('Item Ledger','Item Ledger'[Item No.] = MAX('CSM Listing'[No.]) && 'Item Ledger'[Unit of Measure Code] = MAX('CSM Listing'[Unit of Measure])))

2. Create a measurement value and calculate the difference between the two.

Measure 2 = MAX('CSM Listing'[Total]) - 'CSM Listing'[Measure]

3. The final result is shown in the figure below.

vkaiyuemsft_0-1709713039590.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-kaiyue-msft
Community Support
Community Support

Hi @Atinder ,

1. Create a measure value and calculate the Item ledger total.

Measure =
CALCULATE(SUM('Item Ledger'[On Hand Qty]),FILTER('Item Ledger','Item Ledger'[Item No.] = MAX('CSM Listing'[No.]) && 'Item Ledger'[Unit of Measure Code] = MAX('CSM Listing'[Unit of Measure])))

2. Create a measurement value and calculate the difference between the two.

Measure 2 = MAX('CSM Listing'[Total]) - 'CSM Listing'[Measure]

3. The final result is shown in the figure below.

vkaiyuemsft_0-1709713039590.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-kaiyue-msft ,

Works and thank you!

v-kaiyue-msft
Community Support
Community Support

Hi @Atinder ,

Method 1: Create visual graphics objects.
1. Create the measure value and write the dax expression.

Measure =
MAX('Table 2'[on Hand Qty]) - SUM('Table'[ON HAND Qty])

2. Create a table visual and place the following fields into columns.

vkaiyuemsft_0-1709604421006.png

 

Method 2: Create a calculation sheet.
1. Create a calculation table and write the dax expression.

Table 3 =
VAR _t1 = SUMMARIZE('Table 2','Table 2'[Channel SKU],'Table 2'[Qty Per UOM],'Table 2'[on Hand Qty])
RETURN
_t1

2. Create a calculated column.

BC on hand = CALCULATE(SUM('Table'[ON HAND Qty]),FILTER(ALL('Table'),'Table'[Qty Per UOM]=EARLIER('Table 3'[Qty Per UOM])))

3. Create a calculated column.

Varraince = 'Table 3'[on Hand Qty] - 'Table 3'[BC on hand]


4. The final result is shown in the figure below.

vkaiyuemsft_1-1709604479386.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-kaiyue-msft,

This solution only works for 1 item But I have 100 Sku's with different Unit of measure. I attached the sample file.   I am attaching sample data. 


From this sample data I am trying to get this. 

Atinder_0-1709657992219.png


https://drive.google.com/file/d/1n8UbQsn6DLXxoi7TNCb5aRRFTB2EhvRk/view?usp=sharing

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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
Top Kudoed Authors