Forum Discussion
MahiK
3 years agoRegular Visitor
Unique sum using DAX
PCode PNAME VALUE VC CE ABC 100 XX CE ABC 100 XY MNO 200 YY XM PQR 100 ZZ I want total sum for VALUE column it should only sum values for unique PCode,PName and Value combination like it should ...
MS_Sum
3 years agoFrequent Visitor
Hi MahiK
PTable
Output: 600
Formula:
Total Sum =
SUMX (
SUMMARIZE (
'PTable',
'PTable'[PCode],
'PTable'[PName],
'PTable'[Value],
"Count", CALCULATE (
COUNTROWS('PTable'),
'PTable'[PCode] = EARLIER('PTable'[PCode]),
'PTable'[PName] = EARLIER('PTable'[PName]),
'PTable'[Value] = EARLIER('PTable'[Value])
)
),
IF([Count] = 1, PTable[Value], 'PTable'[Value])
)
Try and see if it works for you. If yes could you please mark it as a solution and give a kudo 🙂