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 ...
- 3 years ago
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.
parry2k
3 years agoSuper 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.
- mmar1413 years agoFrequent 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] - mmar1413 years agoFrequent Visitor
Wow. I was overthinking this. Much appreciated!