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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
fslef
Microsoft Employee
Microsoft Employee

Summarize date with input data = 1 collumn per day

Hello,

I have an Excel spreadsheet as an input file with the following data:

Project Name01/01/202002/01/202003/01/202004/01/202005/01/202006/01/202007/01/202008/01/202009/01/202010/01/2020
Project 18884  44  
Project 2   4  4488



These data are representing a project workload per day / per project.
How can I proceed to summarize my data per week or month (but still per project)?

Thanks in advance for your help

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @fslef , 

Yes, as @Martin1986 mentioned, you could try to use M code to convert table, then calculate it. You could try below M code and refer to my sample for details.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKz0pNLlEwVNJRskDCJkCsAMUmKPxYHYQuIyRVCjh0QUyMjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Project Name" = _t, #"01/01/2020" = _t, #"02/01/2020" = _t, #"03/01/2020" = _t, #"04/01/2020" = _t, #"05/01/2020" = _t, #"06/01/2020" = _t, #"07/01/2020" = _t, #"08/01/2020" = _t, #"09/01/2020" = _t, #"10/01/2020" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project Name", type text}, {"01/01/2020", Int64.Type}, {"02/01/2020", Int64.Type}, {"03/01/2020", Int64.Type}, {"04/01/2020", Int64.Type}, {"05/01/2020", type text}, {"06/01/2020", type text}, {"07/01/2020", Int64.Type}, {"08/01/2020", Int64.Type}, {"09/01/2020", Int64.Type}, {"10/01/2020", Int64.Type}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Project Name"}, "Attribute", "Value"),
    #"Changed Type with Locale" = Table.TransformColumnTypes(#"Unpivoted Other Columns", {{"Attribute", type date}}, "aa-DJ"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type with Locale",{{"Value", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "week", each Date.WeekOfYear([Attribute])),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "month", each Date.Month([Attribute]))
in
    #"Added Custom1"

Best Regards,
Zoe Zhi

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

 

View solution in original post

2 REPLIES 2
dax
Community Support
Community Support

Hi @fslef , 

Yes, as @Martin1986 mentioned, you could try to use M code to convert table, then calculate it. You could try below M code and refer to my sample for details.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCijKz0pNLlEwVNJRskDCJkCsAMUmKPxYHYQuIyRVCjh0QUyMjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Project Name" = _t, #"01/01/2020" = _t, #"02/01/2020" = _t, #"03/01/2020" = _t, #"04/01/2020" = _t, #"05/01/2020" = _t, #"06/01/2020" = _t, #"07/01/2020" = _t, #"08/01/2020" = _t, #"09/01/2020" = _t, #"10/01/2020" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project Name", type text}, {"01/01/2020", Int64.Type}, {"02/01/2020", Int64.Type}, {"03/01/2020", Int64.Type}, {"04/01/2020", Int64.Type}, {"05/01/2020", type text}, {"06/01/2020", type text}, {"07/01/2020", Int64.Type}, {"08/01/2020", Int64.Type}, {"09/01/2020", Int64.Type}, {"10/01/2020", Int64.Type}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Project Name"}, "Attribute", "Value"),
    #"Changed Type with Locale" = Table.TransformColumnTypes(#"Unpivoted Other Columns", {{"Attribute", type date}}, "aa-DJ"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type with Locale",{{"Value", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "week", each Date.WeekOfYear([Attribute])),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "month", each Date.Month([Attribute]))
in
    #"Added Custom1"

Best Regards,
Zoe Zhi

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

 

Martin1986
Frequent Visitor

Hi, go to the Query Editor for this table, then select the Project column and go to Transform > Unpivot Columns > Unpivot Other Columns. This gives you an attribute column (which you can rename to Date and also convert to datetype) and a Value column.

 

After this you can simply summarize the Value column.

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.