Forum Discussion
DaxBoi
5 years agoNew Member
Conditional SUM
I have a dataset that looks like the following. For each ID there is an Attribute which has a score. There is also a target 0-4 with a weighting. I'm looking to create a visual with a diffe...
Greg_Deckler
5 years agoCommunity Champion
DaxBoi - You said:
"For clarity, I'm looking to sum based on a number of attributes - such as ID, and Attribute. And then do a second calculation (finding the differential) based on the same attributes"
PBIX is attached under sig, Table (4)
So, 2 columns:
Sum Target Weight =
VAR __Table =
ADDCOLUMNS(
FILTER('Table (4)',[ID]=EARLIER([ID]) && [Attribute]=EARLIER([Attribute])),
"Product",[Target]*[Weighting]
)
RETURN
SUMX(__Table,[Product])
Diff =
VAR __Table =
ADDCOLUMNS(
FILTER('Table (4)',[ID]=EARLIER([ID]) && [Attribute]=EARLIER([Attribute])),
"Product",[Score]*[Weighting]
)
RETURN
SUMX(__Table,[Product]) - [Column]