Forum Discussion
Pentanol
8 years agoFrequent Visitor
Time Intelligence DTD
Hi all, I searched for this and couldn't find any similar to my situation. I'm tracking a competitors price for all similar products every day as well as our own prices. Trying to come up with a cal...
- 8 years ago
HI Pentanol
Andrew
Try this solution
First Add a calculated Column which will RANK the dates for each SKU
Date RANK = RANKX ( FILTER ( ALL ( Table1 ), Table1[SKU] = EARLIER ( Table1[SKU] ) ), Table1[Date], , ASC, DENSE )Now you can get the Change in Difference using this Calculated Column
Change_In_Difference = VAR previousDayDifference = CALCULATE ( SUM ( Table1[Comp Price] ) - SUM ( Table1[Our Price] ), FILTER ( ALLEXCEPT ( Table1, Table1[SKU] ), Table1[Date RANK] = EARLIER ( Table1[Date RANK] ) - 1 ) ) VAR CurrentDayDifference = Table1[Comp Price] - Table1[Our Price] RETURN CurrentDayDifference - previousdayDifference - 8 years ago
Zubair_Muhammad
Community Champion
8 years agoHI Pentanol
Andrew
Try this solution
First Add a calculated Column which will RANK the dates for each SKU
Date RANK =
RANKX (
FILTER ( ALL ( Table1 ), Table1[SKU] = EARLIER ( Table1[SKU] ) ),
Table1[Date],
,
ASC,
DENSE
)Now you can get the Change in Difference using this Calculated Column
Change_In_Difference =
VAR previousDayDifference =
CALCULATE (
SUM ( Table1[Comp Price] ) - SUM ( Table1[Our Price] ),
FILTER (
ALLEXCEPT ( Table1, Table1[SKU] ),
Table1[Date RANK]
= EARLIER ( Table1[Date RANK] ) - 1
)
)
VAR CurrentDayDifference = Table1[Comp Price] - Table1[Our Price]
RETURN
CurrentDayDifference - previousdayDifference- Zubair_Muhammad8 years ago
Community Champion