Forum Discussion
mmar141
3 years agoFrequent Visitor
Finding the difference two sources from a single column.
Hello,
I need help with a measure to find the differences between two sources.
My table looks like this
And I'd need the measure to calculate the difference
like this
Can anyone help?
mmar141 add following measures:
Sum Value = SUM ( Table[Value] ) Sum Source A = CALCULATE ( [Sum Value], Table[Source] = "A" ) Sum Source B = CALCULATE ( [Sum Value], Table[Source] = "B" ) Sum Diff = [Sum Source B] - [Sum Source A]Use these measures in the visual and you should be good to go.
4 Replies
- parry2kSuper User
mmar141 add following measures:
Sum Value = SUM ( Table[Value] ) Sum Source A = CALCULATE ( [Sum Value], Table[Source] = "A" ) Sum Source B = CALCULATE ( [Sum Value], Table[Source] = "B" ) Sum Diff = [Sum Source B] - [Sum Source A]Use these measures in the visual and you should be good to go.
- mmar141Frequent Visitor
I get the error
The syntax for 'Value' is incorrect. (DAX(Sum Value = SUM ( 'Table'[Value] )Sum Source A = CALCULATE ( [Sum Value], 'Table'[Source] = "A" )Sum Source B = CALCULATE ( [Sum Value], 'Table'[Source] = "B" )Sum Difference = [Sum Source B] - [Sum Source A] )).
Difference = Sum Value = SUM ( 'Table'[Value] )Sum Source A = CALCULATE ( [Sum Value], 'Table'[Source] = "A" )Sum Source B = CALCULATE ( [Sum Value], 'Table'[Source] = "B" )Sum Difference = [Sum Source B] - [Sum Source A] - mmar141Frequent Visitor
Wow. I was overthinking this. Much appreciated!