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
MOMOMO
Frequent Visitor

New table with sum from other tables

I have 3 different tables as follows:

Inventory

forecast

pending 

 

 

ProductPackagingInventory
ADrum30
BBulk40
CDrum35

 

ProductPackagingdateforecast
ADrumSep 20212
BDrumAug 202130
BBulkDec 202150
CBulkJan 2022

8

 

ProductPackagingdatepending
ADrumJun 20212
BBulkJul 20213
CDrumJul 20215

I want to create a new measure which compares the inventory, forecast, and pending for the same packaging as follows

PackagingInventoryForecastpending
Drum   
Bulk   

I want to export this new measure to a table or a visual on my page so that I would show me the result when I chose a specific product.

 

how can I do that?

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @MOMOMO 

Please correct me if I wrongly understood your problem .

First you need append the three data tables to become a new table .You can append them in Query Editor .You will get a new table named “Append1” .

Ailsa-msft_0-1623827553721.png

Then create measures to sum forecast, inventory, pending .

sum forecast = CALCULATE(SUM(Append1[forecast]),ALLEXCEPT(Append1,Append1[Packaging]))

sum inventory = CALCULATE(SUM(Append1[Inventory]),ALLEXCEPT(Append1,Append1[Packaging]))

sum pending = CALCULATE(SUM(Append1[pending]),ALLEXCEPT(Append1,Append1[Packaging]))

Add a table visual with Append1[Packaging] , sum forecast, sum inventory, sum pending , you will get a result like this .

Ailsa-msft_1-1623827553722.png

Add a slicer with the field Append1[Packaging] , and you can through selecting Packaging to return different values for forecast, inventory, pending .

The effect is as shown :

Ailsa-msft_2-1623827553723.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

 

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

3 REPLIES 3
v-yetao1-msft
Community Support
Community Support

Hi @MOMOMO 

Please correct me if I wrongly understood your problem .

First you need append the three data tables to become a new table .You can append them in Query Editor .You will get a new table named “Append1” .

Ailsa-msft_0-1623827553721.png

Then create measures to sum forecast, inventory, pending .

sum forecast = CALCULATE(SUM(Append1[forecast]),ALLEXCEPT(Append1,Append1[Packaging]))

sum inventory = CALCULATE(SUM(Append1[Inventory]),ALLEXCEPT(Append1,Append1[Packaging]))

sum pending = CALCULATE(SUM(Append1[pending]),ALLEXCEPT(Append1,Append1[Packaging]))

Add a table visual with Append1[Packaging] , sum forecast, sum inventory, sum pending , you will get a result like this .

Ailsa-msft_1-1623827553722.png

Add a slicer with the field Append1[Packaging] , and you can through selecting Packaging to return different values for forecast, inventory, pending .

The effect is as shown :

Ailsa-msft_2-1623827553723.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

 

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

amitchandak
Super User
Super User

@MOMOMO , create common dimension/s for product and packaging

 

distinct(union(distinct(inventory[Product]),distinct(packaging[Product]),distinct(forecasting[Product])))

refer my video

https://www.youtube.com/watch?v=Bkf35Roman8

 

 

Join them with your tables and analyze them together

 

 

How to do in power query

https://www.youtube.com/watch?v=kU2M1LmNvNo

https://www.youtube.com/watch?v=vHuhbvYCiNc

i can create only one common dimension (packaging) per table and sum per this dimension. However, i cant  filter this by procut because I have one dimension in my table

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.