Forum Discussion

VistaDee's avatar
VistaDee
Frequent Visitor
5 years ago
Solved

LEFT JOIN creating Duplicate in SUM

So I was wondering if I could get some help withi this:

 

I have 2 seperate tables:

Projects
ProjectIDProjectNameProjectCost
123456Tilling Kitchen150
545454Painting Hallway100
125877Wallpapering Bedroom200
Jobs
JobIDJobProjectID
1Buy Grout123456
2Take Measurements123456
3Bought Paper125877

 

But because I need a table that shows projects whether they have a job or not, I set up a new Merged table as below:

 

AllProjectsAndJobs
ProjectIDProjectNameProjectCostJobIDJobProjectID
123456Tiles and Tubs1501Buy Grout123456
123456Tiles and Tubs1502Take Measurements123456
545454Paint and Brushes100   
125877Wallpaper and Glue2003Bought Paper125877

 

The problem I have is that because project 123456 has 2 jobs and I want a table to just show the Project and its costs, its duplicating the value for 123456 as it has 2 job entries:

 

 

How do I get around this? 

 

Thanks

 

 

  • VistaDee , You can create a join between these two assume projects has unique project only. 1-M join(No need to merge)

     

    a measure like this should have give you projects with no jobs too

    count(Jobs[ProjectID])+0

1 Reply

  • VistaDee , You can create a join between these two assume projects has unique project only. 1-M join(No need to merge)

     

    a measure like this should have give you projects with no jobs too

    count(Jobs[ProjectID])+0