Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
97 | |
75 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |