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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Merging two datasets into one Data Table

Hey,

 

I am struggling with trying to return a specific type of informaion and combine into one data table.

 

I want a data table that shows me the following:

 

Technician NameHours Budgeted to WorkHours Actually Worked
Bob1012
Larry15

10

Cindy1011

 

The problem I am having is that I have two data sets that have this information.  Both Data Sets contain the Technician's Name, but one data set contains the Hours Budgeted and the second data set contais the Hours actually worked.  The hours actually worked has multiple time sheets like on-site time, travel time, break time, etc.  I only want the on-site time calculated as the Hours actually worked and then added to the same data table.

 

What function can do this?  I played around with SumX but I don't think that is it.  

 

Can you help?

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

Hi, @Anonymous 

 

Based on your description, i created data to reproduce your scenario. The pbix file is attached in the end.

Actual:

e1.png

 

Budget:

e2.png

 

You may create a calculated table with the following dax.

Table = 
ADDCOLUMNS(
    Budget,
    "Hours Actually Worked",
    CALCULATE(
        SUM(Actual[Actual Value]),
        FILTER(
            Actual,
            [Name]=EARLIER(Budget[Name])&&
            [Time Sheets]="on-site time"
        )
    )
)

 

Result:

e3.png

 

Best Regards

Allan

 

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

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, i created data to reproduce your scenario. The pbix file is attached in the end.

Actual:

e1.png

 

Budget:

e2.png

 

You may create a calculated table with the following dax.

Table = 
ADDCOLUMNS(
    Budget,
    "Hours Actually Worked",
    CALCULATE(
        SUM(Actual[Actual Value]),
        FILTER(
            Actual,
            [Name]=EARLIER(Budget[Name])&&
            [Time Sheets]="on-site time"
        )
    )
)

 

Result:

e3.png

 

Best Regards

Allan

 

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

AliceW
Power Participant
Power Participant

you could create a relationship between the tables in your data model based on the technician's name (I assume it's going to be a one-to-one relationship?) Then you can display any columns in one table.

Ashish_Mathur
Super User
Super User

Hi,

Share the 2 datasets in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.