Forum Discussion
Creating Difference between two Values for geographical Chart
- 7 years ago
Hi yashdsin,
If you want to calculate the difference for the product per month, you could create the calcualted columns below.
Please note that you need to change the data type of Index column to be whole number after creating it.
Index = RIGHT('Table'[Sales],1) Difference = VAR a = CALCULATE ( MAX ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Index] = EARLIER ( 'Table'[Index] ) - 1 && 'Table'[Date] = EARLIER ( 'Table'[Date] ) ) ) RETURN IF ( a = BLANK (), BLANK (), a - 'Table'[Value] )Then you could create the matrix like below.
PS: We cannot achieve the same output as that in excel.
Hope this can make sense.
Best Regards,
Cherry
No, Actually i need to see the diffrence between two cells Subtracting Product1 & Product2 in cell B2 & B3 i should be getting results in Cell B4 and so on for all the columns C, D, E etc but i am getting it as a whole for Product1 & 2 respectively as a total which is not required. Please help as i am still a learner.
Hi yashdsin,
If you want to calculate the difference for the product per month, you could create the calcualted columns below.
Please note that you need to change the data type of Index column to be whole number after creating it.
Index = RIGHT('Table'[Sales],1)
Difference =
VAR a =
CALCULATE (
MAX ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Index]
= EARLIER ( 'Table'[Index] ) - 1
&& 'Table'[Date] = EARLIER ( 'Table'[Date] )
)
)
RETURN
IF ( a = BLANK (), BLANK (), a - 'Table'[Value] )
Then you could create the matrix like below.
PS: We cannot achieve the same output as that in excel.
Hope this can make sense.
Best Regards,
Cherry