We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi folks,
I will be recieving the below attendance data each month in a separate excel file. how do I automate the ingestion for all months, considering each file is going to have different dates in columns . needyou help
| SL # | Name | Emp ID | Tower | Team | 1-Aug | 2-Aug | 3-Aug | 4-Aug | 5-Aug | 6-Aug | 7-Aug | 8-Aug |
| 1 | aaa | 123 | PTP | MDM | Working | Working | Working | Working | Working | Working | ||
| 2 | vv | 2424 | PTP | MDM | Paid Leave | Working | Sick Leave | UPL | Sick Leave | Working | ||
| 3 | vvv | 2432 | PTP | MDM | Working | Working | Working | Working | Paid Leave | Paid Leave | ||
| 4 | vvv | 42424 | PTP | MDM | Working | Working | Working | Working | Paid Leave | Paid Leave |
Solved! Go to Solution.
Hi @datamp ,
The most robust way to ingest monthly attendance files (each with different date columns) is to load them from a single folder and transform them in one go. Power Query can automatically apply the same transformation to every file, unpivot the date columns, and convert the date headers (like 1-Aug) into proper dates.
You can try below steps.
In the combined query,:
Step-by-step outline (Power BI / Power Query)
Put files in a folder
Create a folder
(for example: C:\Attendance\Monthly) and drop each month’s Excel file there.
Connect to the folder
In Power BI Desktop > Get Data > Folder.
Browse to your folder and click Combine > Transform Data.
In the Sample File / Combined query, define the transformation
Identify fixed columns (these don’t get unpivoted): e.g. SL #, Name, Emp ID, Tower, Team.
Unpivot the remaining columns (these are your date columns like 1-Aug, 2-Aug, …).
Example (conceptual M code inside the “Transform File” function that Power Query creates for you)
The exact code is generated by Power Query, but you’ll typically end up with something like:
Unpivot:
Keep columns: {"SL #","Name","Emp ID","Tower","Team"}
Unpivot other columns to: Attribute (this holds the header like "1-Aug"), Value (the attendance/status)
Parse the header into a real Date:
Add a column DateHeader = [Attribute] (trim as needed)
Split DateHeader by "-" to get Day and MonthAbbrev
Map MonthAbbrev to a month number (Jan=1, Feb=2, …, Aug=8, etc.)
Decide on Year:
If you have the year in the file name (recommended), extract Year from [Name] or [Source.Name].
Otherwise, use the current year or a parameter you set per file.
Create a real Date column:
Date = #date(Year, MonthNumber, Day)
Clean up and rename:
Remove the temporary header column (Attribute or DateHeader)
Ensure Status values are clean (trim, normalize spaces)
Please mark this post as solution if it helps you. Appreciate Kudos.
Hi @datamp ,
We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.
Best Regards,
Chaithra E.
Hi @datamp ,
Thank you @FarhanJeelani for your inputs.
I hope the information provided is helpful. I wanted to check whether you were able to resolve the issue with the provided solutions. Please let us know if you need any further assistance.
Thank you.
Hi @datamp ,
The most robust way to ingest monthly attendance files (each with different date columns) is to load them from a single folder and transform them in one go. Power Query can automatically apply the same transformation to every file, unpivot the date columns, and convert the date headers (like 1-Aug) into proper dates.
You can try below steps.
In the combined query,:
Step-by-step outline (Power BI / Power Query)
Put files in a folder
Create a folder
(for example: C:\Attendance\Monthly) and drop each month’s Excel file there.
Connect to the folder
In Power BI Desktop > Get Data > Folder.
Browse to your folder and click Combine > Transform Data.
In the Sample File / Combined query, define the transformation
Identify fixed columns (these don’t get unpivoted): e.g. SL #, Name, Emp ID, Tower, Team.
Unpivot the remaining columns (these are your date columns like 1-Aug, 2-Aug, …).
Example (conceptual M code inside the “Transform File” function that Power Query creates for you)
The exact code is generated by Power Query, but you’ll typically end up with something like:
Unpivot:
Keep columns: {"SL #","Name","Emp ID","Tower","Team"}
Unpivot other columns to: Attribute (this holds the header like "1-Aug"), Value (the attendance/status)
Parse the header into a real Date:
Add a column DateHeader = [Attribute] (trim as needed)
Split DateHeader by "-" to get Day and MonthAbbrev
Map MonthAbbrev to a month number (Jan=1, Feb=2, …, Aug=8, etc.)
Decide on Year:
If you have the year in the file name (recommended), extract Year from [Name] or [Source.Name].
Otherwise, use the current year or a parameter you set per file.
Create a real Date column:
Date = #date(Year, MonthNumber, Day)
Clean up and rename:
Remove the temporary header column (Attribute or DateHeader)
Ensure Status values are clean (trim, normalize spaces)
Please mark this post as solution if it helps you. Appreciate Kudos.
Thanks for your help mate
Hi @datamp - Use Power Query to create a dynamic solution that handles variable date columns and appends all files automatically. eg., Save all monthly attendance Excel files in the same folder (e.g., C:\AttendanceFiles\).Make sure files follow a consistent structure.
In Power query editor , use get data >> folder option to extract all the files and combine the files into one file>> use unpivot other column transformation on dates (1-Aug, 2-Aug,3-Aug and so on) by selecting this columns.
you will see attibutes and values . Hope the above process works
if possible you can also provide sample data will do it and share the output.
Thank you.
Proud to be a Super User! | |
Thanks for your prompt response. I selected the common column like emp id and others and then chose unpivot other columns, the problem I ma facing is the Sep mont column names are in rows and not columns
@datamp -if possible, please share sample data to work on. will check.
Thank you.
Proud to be a Super User! | |
You need to have them in the rows - Power BI needs long skinny tables, not wide and short. You can have the dates in columns in a visual if you want, but the best format for ingestion is what @rajendraongole1 suggested - making them skinny and long.
Proud to be a Super User! | |
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |