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
depple
Helper III
Helper III

Measure - Combine data from to tables

Hi,

 

Power BI newbie here. My question is probably pretty basic.

 

I would like to build a matrix where values from two tables are presented.

 

The simplied table structure is like this:

 

"Warehouse Inventory" 
Warehouse|ProductID|Current Stock

 

"Deliveries Last Period" 
Warehouse|Product ID|Delivered

 

In the Matrix I would like to present

Warehouse   Product ID   Current Stock    Delivered

 

I am guessing that a measure for this would be appropriate, but I have not been able to find a solution that I can convert into my use (or understand!).

 

It would be deeply appreciated if anyone could point me in the right direction.

 

/depple

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

looking at your example I would:
1) Create a table that contains all the Warehouses, do join with Inventory and Deliveries on WarehouseIDs

2) create a table that contain all product Ids,, do join with Inventory and Deliveries on Product Ids

3) create a visual with warehouse name from table 1), product from table 2), and deliveries and stock from respective tables

alternatively you could join the two tables and get the data from there



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @depple

 

You can do it with a measure but I believe a better solution would be to merge both tables in the query editor or by adding a a calculated column to one of the two tables. If you really want to go the measure way:

 

1. Set  'Warehouse Inventory'[Warehouse] and 'Warehouse Inventory'[|ProductID] and 'Warehouse Inventory'[Current Stock] in the rows of a matrix visual

2. Set this measure in values of the matrix:

 

 

Measure =
LOOKUPVALUE (
    'Deliveries Last Period'[Delivered],
    'Deliveries Last Period'[Warehouse], SELECTEDVALUE ( 'Warehouse Inventory'[Warehouse] ),
    'Deliveries Last Period'[ProductID], SELECTEDVALUE ( 'Warehouse Inventory'[ProductID] )
)

 

 

 

Stachu
Community Champion
Community Champion

looking at your example I would:
1) Create a table that contains all the Warehouses, do join with Inventory and Deliveries on WarehouseIDs

2) create a table that contain all product Ids,, do join with Inventory and Deliveries on Product Ids

3) create a visual with warehouse name from table 1), product from table 2), and deliveries and stock from respective tables

alternatively you could join the two tables and get the data from there



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

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.