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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply

I'm getting duplicated rows when table relationships are established...

Hi,

 

I am currently working on 2 tables the first table has an employees total hours for the day and the second table is the department details of the employee. When I establish a relationship and combine them with my date dim I get repeated rows.

 

I would really appreciate your help on this.

 

PBIERROR.PNG

 

Table 1

 

EIDENTRY DATEHOURS
11111101/01/20192
11111105/01/20191
11111106/01/20192
11111107/01/20193
11111108/01/20194
11111109/01/20192

 

Table 2 

 

EIDDEPARTMENTEFFECTIVE DATEEND DATE
111111HR01/01/201905/01/2019
111111FINANCE06/01/2019 

 

Thank you,

 

Patrick

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

hi, @PatrickLamoste 

Since your two table is a many to many relationship, and there is no [DEPARTMENT] filed in table1, so it will lead to this result.

And from your sample data, I think this your expected output.

Create a measure instead of drag [Hours] into visual directly.

Measure = 
CALCULATE (
    SUM ( Table1[HOURS] ),
    FILTER (
        Table1,
        Table1[ENTRY DATE] >= MIN ( Table2[EFFECTIVE DATE] )
            && Table1[ENTRY DATE]
                <= IF (
                    MAX ( Table2[END DATE] ) = BLANK (),
                    DATE ( 9999, 12, 31 ),
                    MAX ( Table2[END DATE] )
                )
    )
)

 Result:

4.JPG

and here is sample pbix file, please try it.

 

Best Regards,

Lin

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @PatrickLamoste 

Since your two table is a many to many relationship, and there is no [DEPARTMENT] filed in table1, so it will lead to this result.

And from your sample data, I think this your expected output.

Create a measure instead of drag [Hours] into visual directly.

Measure = 
CALCULATE (
    SUM ( Table1[HOURS] ),
    FILTER (
        Table1,
        Table1[ENTRY DATE] >= MIN ( Table2[EFFECTIVE DATE] )
            && Table1[ENTRY DATE]
                <= IF (
                    MAX ( Table2[END DATE] ) = BLANK (),
                    DATE ( 9999, 12, 31 ),
                    MAX ( Table2[END DATE] )
                )
    )
)

 Result:

4.JPG

and here is sample pbix file, please try it.

 

Best Regards,

Lin

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

Thank you! This works perfectly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.