Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe'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
So here is the scenario: We want to get the weekly average of employee attendance in the office, be able to classify them according to how many days they went to the office (e.g. 0 day, Less than 1 day, 1 day, etc.), and be able to filter according to date, business unit, and other employee details.
The data that I have right now are separated into two: first is the Employee Details table, and the raw Attendance table. I mainly just use excel and merge the attendance table to the Employee Details table, so it would like a bit like this:
| Employee ID | Business Unit | Grade | Generation | 1/2/2023 | 1/3/2023 | 1/4/2023 | 1/5/2023 | 1/6/2023 | Week 1 Sum | 1/9/2023 | 1/10/2023 | 1/11/2023 | 1/12/2023 | 1/13/2023 | Week 2 Sum |
| A | Legal | 5 | Gen X | 1 | 0 | 0 | 1 | 0 | 2 | 1 | 1 | 1 | 1 | 1 | 5 |
In order to get the Weekly Average of all the Week X Sum columns, I have a Weekly Avg column at the end of the table, which is just =average(all Week X columns). The tricky part is when I try to unpivot this table by using the Weekly Avg column as the Attribute, I no longer have the date/week references which means that I could no longer filter them by date.
I tried unpivoting by using the Week X Sum columns and appended a Calendar table to get the dates associated with each week, but the resulting table doesn't filter by date properly and I also don't have decimal points in the Value (which means I wouldn'tbe able to get the Less than a day classification since the Week X Sum Columns are just whole numbers of 0-5)
I also tried the Group By function, but it all ended up with the same result above.
Hoping that I would be able to get some answers. I've been at this for a month and I'm all out of options
I tried unpivoting by using the Week X Sum columns and appended a Calendar table
That sounds vaguely like a good idea.
Please provide sample data that FULLY covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
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 |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 64 | |
| 39 | |
| 33 | |
| 23 |