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
Syndicate_Admin
Administrator
Administrator

Create new table based on others and with conditions

Good

It turns out that I have two tables, one with information about the current employees of the company who are active called "Business Active Workers" and another with the employees who left the company called "Terminated Workers".

I need to create a new table that contains the data of all the employees who worked during the past month. That is, it must contain the employees who worked last month and continue to do so today (who are in Business Active Workers) and also those who worked last month and are no longer in the company today (who are only in Terminated Workers).

I would like to do this with DAX since for some reason every time I do a merge or append in Power Query then I have problems when it comes to scheduling automatic updates on the web.

Could anyone help me with this brown?

Thanks in advance!

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Good @Syndicate_Admin

Thank you for your reply. Indeed, I also believe that the database is not normalized and it is a fight that I have been having for some time, but I have to work despite that problem.

I have managed to make a UNION with both databases to have something similar to what you tell me as follows:

Employees Last Month =
where BAW = SELECTCOLUMNS('Business Active Workers',
"Worker", 'Business Active Workers'[Worker],
"Termination Date", 'Business Active Workers'[Termination Date],
"Hire Date", 'Business Active Workers'[Hire Date],
"Contract Type", 'Business Active Workers'[Employee Contract Type])

where TW = SELECTCOLUMNS('Terminated Workers',
"Worker", 'Terminated Workers'[Full Legal Name],
"Termination Date", 'Terminated Workers'[Termination Date],
"Hire Date", 'Terminated Workers'[Hire Date],
"Contract Type", 'Terminated Workers'[Contract Type])

return
UNION(BAW, TW)
croberts21
Continued Contributor
Continued Contributor

This database is not normalized and this is bad design. All workers should be in a single table with a field to indicate if they are currently active or not. Otherwise you will have many problems with this database. 

I suggest you use combine these tables at the database level, and make a new field called "Termination date". If the Termination Date is blank, they still work there. If there is a Termination Date, they do not work there and the date will tell you when their last day was.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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