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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I'm really stuck with this one, I'd massively appreciate any help.
I have a table with employees in column 0, and then data for each week in each subsequent column. These columnns are named with the date, as shown below:
Employee | 2023 24-Nov | 2023 01-Dec | 2023 08-Dec | 2023 15-Dec |
Jack | 2 | 2 | 8 | 4 |
Jack | 7 | 9 | 8 | 1 |
Jack | 1 | 3 | 5 | 1 |
Amy | 7 | 2 | 9 | 1 |
Amy | 5 | 7 | 2 | 3 |
Amy | 5 | 5 | 4 | 6 |
I need to produce a table with a single row for each employee, and the sum of each week for that employee in the same row, as shown below:
Employee | Week 1 | Week 2 | Week 3 | Week 4 |
Jack | 10 | 14 | 21 | 6 |
Amy | 17 | 14 | 15 | 10 |
I believe Group By is the best function for this. If I use the function (just for the first week to begin with), it works. The code looks like this:
= Table.Group(#"Changed Type", {"Employee"}, {{"Week 1", each List.Sum([#"2023 24-Nov"]), type nullable number}})
The thing is, I don't want to refer to the date columns by their name, as they will change each week when a new report is read in.
I have tried using the following code to produce this table using column index position (for just the first week to begin with), but it doesn't work.
Table.Group(#"Changed Type", {"Employee"}, {{"Week 1", each List.Sum(Table.ColumnNames(#"Changed Type"){1}), type nullable number}})
I get the following error:
If anyone could help that would be great!
Solved! Go to Solution.
Hi @Desyn
You will need to do a bit of transformation before attempting to do what you are doing:
1. Unpivot all date columns so that there are two values in your table (Dates and Values) by selecting Employee column and "unpivot other columns".
2. Then use Group by sum values.
That should give you the output you are after (hopefully).
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi @Desyn
You will need to do a bit of transformation before attempting to do what you are doing:
1. Unpivot all date columns so that there are two values in your table (Dates and Values) by selecting Employee column and "unpivot other columns".
2. Then use Group by sum values.
That should give you the output you are after (hopefully).
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.