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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply

Problem with relationship between two tables and date table

Hi,

 

I'm fairly new to Power Bi and i have a problem on a report.

I searched in the forum but haven't found any exact solution for my problem.

 

I have a report with 4 tables.

 

Dechets_Tricotage is a table where I store scrap quantity for a given OF (Fabrication Order), where each row is a declaration of scrap.

Prod_Tricotage is a table where I store the production details linked to an OF (Efficiency of the machine, Qty produced...)

Date_Table is a table with all the dates between 2019 and 2025 and i use it for filtering

TimeTable is a table with all the hours and minutes of the day with the shift that correspond (AM or PM)

 

The result i want to obtain is a matrix with all the production data by half day (AM and PM) and also the scraps related.

 

I want to have dates in columns and machine OF and Reference in rows.

 

I made a model that almost works, but my problem is that when there is no production data for an half day (PM for example) but there are scraps detected during this half day, the scraps aren't showed in the Matrix.

 

Philippe_Jamon_0-1668876417426.png

Here you can see that on the 16 PM for the OF 37711 i have no scraps but in reality i had one.

 

I made an example PBIX file with similar data.

 

Link to PBIX file on One drive 

 

Link to PBIX file on Google drive 

 

Thanks for helping me.

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

Hi @Philippe_Jamon ,

this should be your final data model

mangaus1111_0-1668885090505.png

and here the correct result

mangaus1111_1-1668885118247.png

 

View solution in original post

4 REPLIES 4
mangaus1111
Solution Sage
Solution Sage

Hi @Philippe_Jamon ,

this should be your final data model

mangaus1111_0-1668885090505.png

and here the correct result

mangaus1111_1-1668885118247.png

 

Hi @mangaus1111 ,

I have One last question.

For the Machine dim table, it's ok because it won't change but for the OF dim table, i need it to be incremented by the Prod_tricotage fact table.

Is it possible ?

Thanks un advance 

Hi @mangaus1111 ,

 

thanks for your help, i think i understood your solution.

Br, 

Philippe 

mangaus1111
Solution Sage
Solution Sage

Hi @Philippe_Jamon ,

the problem in your model is that one fact table filter another fact table and this is why you don´t get the number of the scraps on 16th Nov PM.

 

Make a data model in the correct way like this one

 

mangaus1111_0-1668883026286.png

 

Furthermore you need to create a third dimension table called 'Machine' or 'OF' that is going to filter in your report both the fact tables. If you use the column [Machine] from the 'Prod_Tricotage' table as filter in your report you get only the values of the 'Prod_Tricotage' table.

On the other hand, if you use the column [Machine] from the 'Deschets_Tricotage' table you get only the values of the 'Deschets_Tricotage' table.

 

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

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.