Forum Discussion
Foguete
Helper I
3 years agoAddcolumn, 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
Super User
3 years agohi 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
Super User
3 years agohi 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]
)