cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
timneo Frequent Visitor
Frequent Visitor

Combining timesheet files

I have two timesheet data sources, one for employees and one for contractors.

 

They both use a unique ID, a date and the number of days worked

 

The contractors table has four columns, unique ID, date, hours, number of whole days worked

 

The employee table has a lot of additional information such as cost centres etc which I don't need but am not worried about keeping in it if I'm adding stuff.

 

How do I merge/append/join them? Not sure which I should be using.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Combining timesheet files

HI @timneo,

 

I'd like to suggest you merge them with dax formula.

 

Sample: use selectcolumns and union functions to combine them.

 

Merged =
UNION (
    SELECTCOLUMNS (
        contractors,
        "unique ID", [unique ID],
        "date", [date],
        "hours", [hours],
        "workdays", [workdays],
        "Source", "contractors"
    ),
    SELECTCOLUMNS (
        employees,
        "unique ID", [unique ID],
        "date", [date],
        "hours", [hours],
        "workdays", [workdays],
        "Source", "employees"
    )
)

 

 

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
3 REPLIES 3
Super User
Super User

Re: Combining timesheet files

Use an Append query in Power Query.

 

Or you could use UNION in DAX


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


Community Support Team
Community Support Team

Re: Combining timesheet files

HI @timneo,

 

I'd like to suggest you merge them with dax formula.

 

Sample: use selectcolumns and union functions to combine them.

 

Merged =
UNION (
    SELECTCOLUMNS (
        contractors,
        "unique ID", [unique ID],
        "date", [date],
        "hours", [hours],
        "workdays", [workdays],
        "Source", "contractors"
    ),
    SELECTCOLUMNS (
        employees,
        "unique ID", [unique ID],
        "date", [date],
        "hours", [hours],
        "workdays", [workdays],
        "Source", "employees"
    )
)

 

 

Regards,

Xiaoxin Sheng

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



For learning resources/Release notes, please visit: | |
timneo Frequent Visitor
Frequent Visitor

Re: Combining timesheet files

Gah union! Yes that's the one.  For anyone else doing this, don't forget to change the data type of any date field to date - had me scratching my head for a bit as to why the time slicer wasn't working.