Forum Discussion
sewaktamang
8 years agoFrequent Visitor
% Difference between two date value
How to get % Change between current Week and Previous Week? Any solution ?
- 8 years ago
It gives me correct values
Did you try this formula
Column = VAR Priorday = CALCULATE ( MAX ( TableName[Week] ), FILTER ( ALL ( TableName ), TableName[Week] < EARLIER ( TableName[Week] ) ) ) RETURN DIVIDE ( TableName[Conversions], CALCULATE ( SUM ( TableName[Conversions] ), FILTER ( TableName, TableName[Week] = Priorday ) ) ) - 1 - 8 years ago
sewaktamang
8 years agoFrequent Visitor
It is giving me date value :(
Column
| Friday, 29 December 1899 |
| Saturday, 30 December 1899 |
| Saturday, 30 December 1899 |
| Saturday, 30 December 1899 |
| Saturday, 30 December 1899 |
Zubair_Muhammad
8 years agoCommunity Champion
It gives me correct values
Did you try this formula
Column =
VAR Priorday =
CALCULATE (
MAX ( TableName[Week] ),
FILTER ( ALL ( TableName ), TableName[Week] < EARLIER ( TableName[Week] ) )
)
RETURN
DIVIDE (
TableName[Conversions],
CALCULATE (
SUM ( TableName[Conversions] ),
FILTER ( TableName, TableName[Week] = Priorday )
)
)
- 1
- Zubair_Muhammad8 years agoCommunity Champion
- Zubair_Muhammad8 years agoCommunity Champion
A small improvement to this formula so that you do not get -100% for firstweek/firstdate
HIghlighted in RED font below
Column = VAR Priorday = CALCULATE ( MAX ( TableName[Week] ), FILTER ( ALL ( TableName ), TableName[Week] < EARLIER ( TableName[Week] ) ) ) RETURN IF ( NOT ( ISBLANK ( Priorday ) ), DIVIDE ( TableName[Conversions], CALCULATE ( SUM ( TableName[Conversions] ), FILTER ( TableName, TableName[Week] = Priorday ) ) ) - 1 )