Forum Discussion
Anonymous
4 years agoNot applicable
Summarized Table - Total By Column
Hi I need help to calculate (Total By Company) in my summary table , below is the code for the summarized table : Summary Table =
SUMMARIZE('Table1',
'Table1'[Company],
'Table1'[Type],
...
- 4 years ago
You want to do something like this:
Summary Table = ADDCOLUMNS ( SUMMARIZE( 'Table1', 'Table1'[Company], 'Table1'[Type] ), "Emp", CALCULATE ( DISTINCTCOUNT('Table1'[UserID]) ), "Total Company Emp ", CALCULATE ( DISTINCTCOUNT('Table1'[UserID]), ALLEXCEPT ( Table1, Table1[Company] ) ) )You'll notice I've used SUMMARIZE in combination with ADDCOLUMNS rather than letting SUMMARIZE do the aggregation. Have a read of All The Secrets of Summarize
bcdobbs
4 years agoCommunity Champion
You want to do something like this:
Summary Table =
ADDCOLUMNS (
SUMMARIZE(
'Table1',
'Table1'[Company],
'Table1'[Type]
),
"Emp", CALCULATE ( DISTINCTCOUNT('Table1'[UserID]) ),
"Total Company Emp ", CALCULATE ( DISTINCTCOUNT('Table1'[UserID]), ALLEXCEPT ( Table1, Table1[Company] ) )
)
You'll notice I've used SUMMARIZE in combination with ADDCOLUMNS rather than letting SUMMARIZE do the aggregation. Have a read of All The Secrets of Summarize
- Anonymous4 years agoNot applicable
Perfect , thanks for the support .