Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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],
"TotalEmp",
DISTINCTCOUNT('Table1'[UserID])
)
below is the result of the above code :
| Company | Type | TotalEmp |
| ABC | A1 | 5 |
| XYZ | A2 | 3 |
| ABC | A3 | 4 |
| XYZ | A4 | 10 |
The result I am looking for :
| Company | Division | TotalEmp | Total By Company |
| ABC | A1 | 5 | 9 |
| XYZ | A2 | 3 | 13 |
| ABC | A3 | 4 | 9 |
| XYZ | A4 | 10 | 13 |
Thanks
Solved! Go to Solution.
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
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
Perfect , thanks for the support .
Hi, @Anonymous
Try this:
Summary Table =
SUMMARIZE('Table1',
'Table1'[Company],
"TotalEmp",
DISTINCTCOUNT('Table1'[UserID])
)
Proud to be a Super User!
This not what i am looking for , the column (Type) is missing .. I want the (Total By Company) grouped based on the company with (type) coulmn present in the table .
try using measure like:
Proud to be a Super User!
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 53 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 122 | |
| 108 | |
| 44 | |
| 32 | |
| 26 |