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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Data model pratice - extract and transform tables - SAP ERP

Hi,

 

I want to create a dashbord of the absence of my company and I'm preparing the data model to begin the calculations, but I have some issues that I can't understand why to solve it.

 

I extract a transaction table of the absence that have the following headers: employee nº, absence type, start date, end date, nº days, nº hours (I have the same employee number in several rows that evidence diferents types of absence over time).

 

I want to do the calculations based on employee category, HR area, etc., but the same employee can have several categories and HR area over time, and the data that I extract is in the following way:

 

Employee nºCategoryStart dateEnd date
1Administrative01/01/202030/06/2020
1Manager01/07/202031/08/2020
1 toDirector01/09/2020 

 

Employee nºHR areaStart dateEnd date
1Area101/01/202030/06/2020
1Area201/07/202031/08/2020
1Area101/09/2020 

 

My goal is that the employee 1 counts for the absence of "Administrative" and "Area1" and in august in "Manager" and "Area2".

 

  1. How can I manage the model and relationships between this tables?
  2. The tables above are both transactions tables?

 

Regards,

 

Carlos

5 REPLIES 5
Anonymous
Not applicable

@Anonymous 

@amitchandak @Ashish_Mathur 

Thank You for your help!

 

My problem is how to design the data model.

 

There are some pictures of my data model and tables:

 

Carlos_Ruxa_BI_0-1609409541627.png

 

fContractType:

Carlos_Ruxa_BI_3-1609409838963.png

 

fProfessionalGrp:

Carlos_Ruxa_BI_4-1609409936900.png

 

In this tables, it is possible to have Employee ID repeated because they can change their professional category and contract type over the time.

 

The table fEmployeeData have only one row with each EmployeeID.

 

I'm a beginner in PowerBI, and I have planned do trainning in March, but I want to develop some knowledge until there.

 

Thanks for yours support.

 

 

Hi,

Did my calculated formula work?


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

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated table.

Table = SUMMARIZE('Table1','Table1'[Employee nº],'Table1'[Category],'Table1'[Start date],'Table1'[End date],
"HR area",CALCULATE(MAX('Table2'[HR area]),FILTER('Table2','Table2'[Employee nº]=EARLIER('Table1'[Employee nº])&&'Table2'[Start date]=EARLIER('Table1'[Start date])&&'Table2'[End date]=EARLIER('Table1'[End date]))))

2. Result.

v-yangliu-msft_0-1609319456922.jpeg

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@Anonymous , refer if my HR analytics blog or video can help you

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

https://www.youtube.com/watch?v=e6Y-l_JtCq4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Ashish_Mathur
Super User
Super User

Hi,

If the Start date and End Date columns in both datasets match for the same employee, then write this calculated column formula in Table1

=lookupvalue(Table2[HR Area],Table2[Employee Number],Table1[Employee Number],Table2[Start date],Table1[Start date],Table2[End date],Table1[End date])

Hope this helps.


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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.