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

Combining 2 tables into one for Volume calculations

Hello everyone,

 

We have just developped an algorithm to predict our sales in our various shops and for our various products.

Now we are trying to create a PBI report that would allow us to compare these values against the sales that were forecasted manually by our sales teams and with the real sales values (for the past).

 

For this, I have 3 tables:

- Manual Forecast Table

- Algorithm Table

- Real Sales Table

 

Now the tricky thing is that some combinations (example: Shop 1 & Product 1) can be present in one table but not the others.

In SQL i know that I could do a union of all combinations and then query based on this.

However this is a lot of data and it takes forever to load.

 

I wanted to know if within PBI it was possible to merge them into one table with all lines.

Something like this:

 

2020-04-06_16-29-46.jpg

 

LIke this i would not have to create a table that contains all the combinations of all 3 tables.

 

Thanks a lot!

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@dreyz64 In my opinion you don't need to combine these tables , assume these are fact tables and you can dimension to work with this and can visualize the data from multiple fact table.

 

in this case you will have 3 dimension tables

 

- Store (unique store)

- Product (unique products)

- Date  (date dimension)

 

set relationship with these both tables from all these 3 dimension, dimensions will be on one side of the relationship.

 

In table visual, drop store, product and date column from dimension and Volume from respective table (forecast and algorithm) and everything would work.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

7 REPLIES 7
parry2k
Super User
Super User

@dreyz64 In my opinion you don't need to combine these tables , assume these are fact tables and you can dimension to work with this and can visualize the data from multiple fact table.

 

in this case you will have 3 dimension tables

 

- Store (unique store)

- Product (unique products)

- Date  (date dimension)

 

set relationship with these both tables from all these 3 dimension, dimensions will be on one side of the relationship.

 

In table visual, drop store, product and date column from dimension and Volume from respective table (forecast and algorithm) and everything would work.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k !

Thank you for your answer.

I had tried an approach (maybe a bit similar) which was to create a big table with all my distinct combinations of:

- Store, Product & Dates

And then created 3 tables for my Forecast, Algo and Real sales.

And then i tried to create a relation ship between the main table and the 3 ones.

However it is not giving me good results.

 

I am not sure I understood your method.

What I did now is I created this:

- 1 table with all Geo hierarchies (unique)

- 1 table with all product hierarchies (unique)

- 1 table date (unique)

 then I have my tables with my volumes (e.g. the whole geo hierarchies, product hierarchies, dates & volumes).

 

I have created my relationships but the question now is how do I link my geo hierarchies with my product hierarchies?

I am missing a step...

 

@dreyz64 Not sure what define not getting good results.

 

share, sample pbix and what is not working.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@dreyz64 can you share pbix file with sample data?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k 

Unfortunately I will need to anonymise the workbook as I cannot share it as is.

 

Let me try to explain what I did. I created 3 new tables: 

- Date Table

- Shop Table

- Product Table

 

They are linked to my data tables with a relationship 1 to many, single.

The thing is now, if i want to do a matric with Shops & Products in rows, Date in columns and volumes in values, it does not work because I have no link between the Product table and the Shop Table.

 

Should I make an extra table that contains all the combinations of Shop + Products?

2020-04-07_9-37-54.jpg

 

@dreyz64  you don't need relationship between product and shop table, as soon as you drop the volume from these tables in the values , everythig will work Did you tried that?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k I managed to solve my issue by creating a single main table of metadata and linking it to my tables with my values!
Thank you for your help 🙂

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.