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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Philippe_Jamon
Helper II
Helper II

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors