Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have the below table, I need to create a calculated column "Overall Product and Trn Sales", which will be the sum of SalesAmount for the Trn ID and Product ID summarized.
Trn ID | Brand | Location | Product ID | SalesAmount | Overall Product and Trn Sales |
1 | a | US | 1 | 5 | |
2 | b | UK | 1 | 10 | |
2 | c | CA | 1 | 10 | |
1 | d | IN | 1 | 10 | |
3 | e | DE | 1 | 10 |
Resultant column should look like the below:
The below measure worked,
Overall Product and Trn Sales =
var maxdd=MAX(table[Trn ID]])
var TotalSales=
CALCULATE(
SUM(Table[SalesAmount]),
table[Trn ID]]=maxdd,
ALLEXCEPT(table,table[Product ID])
)
return
TotalSales
Could someone please let me know how the dax for calculated column should be?
Solved! Go to Solution.
@Anonymous , Create a new column like
SUMX(filter(Table, table[Trn ID] = earlier (Trn ID)), Table[SalesAmount])
@Anonymous , Create a new column like
SUMX(filter(Table, table[Trn ID] = earlier (Trn ID)), Table[SalesAmount])