Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello
I'm trying to do a simple summary (simple in Excel i.e. but I can't make Power BI work
If I have the following example table (simplified for this example but the actual data has multiple columns and rows) where I want to add a calculated column, in column D, where I would summarize sales based on the employee.
A | B | C | D | |
1 | Emp | Prod | Sales | SalesXEmp |
2 | ||||
3 | Jones | apple | 100 | 125 |
4 | Blacksmith | apple | 150 | 250 |
5 | Blacksmith | Kiwi | 100 | 250 |
6 | Lake | Kiwi | 75 | 75 |
7 | Jones | Dates | 25 | 125 |
In Excel, my sum formula (in cell D3) is simple: "SUMIF($A:$A,A3,$C:$C).
How do I recreate this summary based on the value of a column (or add using group by) in Power BI using a measure?
Thank you.
Solved! Go to Solution.
Hi @Claudine ,
Try this as a measure:
Sum by Employee =
CALCULATE ( SUM ( 'Table'[Sales] ), ALLEXCEPT ( 'Table', 'Table'[Emp] ) )
Proud to be a Super User!
AS a new column
SalesXEmp = sumx(filter(Table, [Emp]=earlier([Emp])),[Sales])Sales
As a new measure
SalesXEmp = calculate(sum(Table[Sales]),allexcept(Table, Table[Emp]))
Hi @Claudine ,
Try this as a measure:
Sum by Employee =
CALCULATE ( SUM ( 'Table'[Sales] ), ALLEXCEPT ( 'Table', 'Table'[Emp] ) )
Proud to be a Super User!
User | Count |
---|---|
101 | |
90 | |
79 | |
70 | |
70 |
User | Count |
---|---|
112 | |
96 | |
96 | |
75 | |
72 |