Forum Discussion
Anonymous
4 years agoNot applicable
Total Sum by Column (Matrix)
Created a gantt chart using matrix. I want to display the row total count with value for each date. Below is the image on the table i've been working out, together with the formula that I used to dis...
- 4 years ago
Hi, Anonymous
Try to create a measure like this:
_Measure = SUMX('sample data',[column values])Result:
Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
if source is your tab,
then open an empty query and paste the following code ovewriting all.
let
Start_End = (SD, ED, optional Culture as nullable text) as table =>
let
StartDate= Date.FromText(SD,[Format="dddd d MMMM yyyy", Culture=Culture]),
EndDate= Date.FromText(ED,[Format="dddd d MMMM yyyy", Culture=Culture]),
DayCount = Duration.Days(Duration.From(EndDate - StartDate))+1,
Source = List.Dates(StartDate,DayCount,#duration(1,0,0,0)),
TableFromList = Table.FromList(Source, Splitter.SplitByNothing()),
ChangedType = Table.TransformColumnTypes(TableFromList,{{"Column1", type date}}),
RenamedColumns = Table.RenameColumns(ChangedType,{{"Column1", "Date"}}),
res= Table.AddColumn(RenamedColumns, "gant", each 1)
in
res,
#"Grouped Rows" = Table.Group(source, {"Category", "Name", "Task Type", "Assigned To"}, {"from to", each Start_End([Start Date]{0},[Expected End Date]{0},"it-IT")}),
#"Expanded from to" = Table.ExpandTableColumn(#"Grouped Rows", "from to", {"Date", "gant"}, {"Date", "gant"}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Expanded from to", {{"Date", type text}}, "it-IT"), List.Distinct(Table.TransformColumnTypes(#"Expanded from to", {{"Date", type text}}, "it-IT")[Date]), "Date", "gant", List.Sum),
#"Grouped Rows1" = Table.Group(#"Expanded from to", {"Date"}, {{"total", each List.Sum([gant]), type number}}),
#"Transposed Table" = Table.Transpose(#"Grouped Rows1"),
GranTotal = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true])
in
Table.Combine({#"Pivoted Column",GranTotal})