Forum Discussion
Foguete
3 years agoHelper I
Addcolumn, different cases, summarize
Hello, I need help as I am trying to build a table with a case I never face untill now. I currently have a table with different line that I want to summarize. For example: date task ce...
FreemanZ
3 years agoSuper User
hi Foguete
try to create a calculated table like:
Table =
VAR _table=
ADDCOLUMNS(
SUMMARIZE(
TableName,
TableName[Date],
TableName[task]
),
"center", "c",
"Qty", CALCULATE(SUM(TableName[Qty]))
)
RETURN
UNION(TableName, _table)
verified and worked like this:
FreemanZ
3 years agoSuper User
hi Foguete
if you mind the column ordering, try this:
Table =
VAR _table=
ADDCOLUMNS(
SUMMARIZE(
TableName,
TableName[Date],
TableName[task]
),
"center", "c",
"Qty", CALCULATE(SUM(TableName[Qty]))
)
VAR _table2= UNION(TableName, _table)
RETURN
SELECTCOLUMNS(
_table2,
"date", TableName[date],
"center", TableName[center],
"task", TableName[task],
"qty", TableName[qty]
)