Forum Discussion
romovaro
Responsive Resident
4 years agoComparing Dates (Slippage) vs current Go Live Date Month
HI all,
I have the table below showing CUID Number (=project number), GLD (Go Live Date) and the GLD that had this project in prev months.
What I am trying to achieve is to track the changes ...
- 4 years ago
Thanks for attaching the report.
Change the period column to type text then this measure works
Previous Period Changed? =var _currentPeriod =SELECTEDVALUE(RPT10[Period])var _currentGLD =FORMAT(SELECTEDVALUE(RPT10[GLD]), "YYYY-MM")var _prevPeriod =FORMAT(EOMONTH(_currentPeriod,-1), "YYYY-MM")var _prevGLD =FORMAT(LOOKUPVALUE(RPT10[GLD],RPT10[Period Column],_prevPeriod, RPT10[CUID], SELECTEDVALUE(RPT10[CUID])), "YYYY-MM")ReturnIF(// test for beginning for date listISBLANK(_prevPeriod) || _prevPeriod = "","No Change",IF(_currentGLD = _prevGLD,"No Change","CHANGED")) - 3 years ago
CALCULATE(
MIN(RPT10[GLD]),
ALLEXCEPT(RPT10, RPT[CUID])
)should pull the earliest date for each CUID
- 3 years ago
You should be able to change the Initial GLD Changed measure to
Inital GLD Changed =
SWITCH(
TRUE(),
RPT10[GLD] = [Earliest GLD], "No Change",
DATEDIFF([Earliest GLD], RPT10[GLD], MONTH) >=3, "Changed +3",
DATEDIFF([Earliest GLD], RPT10[GLD], MONTH) <3, "Changed")
jgeddes
Super User
3 years agoFor this case we will need to change from a measure to a calculated column.
In your RPT10 table add the calculated column;
Changed GLD? =
var _currentPeriod =
RPT10[Period]
var _currentGLD =
FORMAT(RPT10[GLD], "YYYY-MM")
var _prevPeriod =
FORMAT(EOMONTH(_currentPeriod,-1), "YYYY-MM")
var _prevGLD =
FORMAT(LOOKUPVALUE(RPT10[GLD],RPT10[Period Column],_prevPeriod, RPT10[CUID], RPT10[CUID]), "YYYY-MM")
var _gldDifference =
abs(DATEDIFF(DATEVALUE(_currentGLD),IF(OR(ISBLANK(_prevGLD),_prevGLD=""),DATEVALUE(_currentGLD),DATEVALUE(_prevGLD)),MONTH))
Return
IF(
// test for beginning for date list
ISBLANK(_prevPeriod) || _prevPeriod = "",
"No Change",
IF(
_gldDifference = 0,
"No Change",
IF(
_gldDifference < 3,
"Changed",
"Changed+3"
)
)
)
You now use the calculated column in the matrix visual instead of the measure. You can then use that column as a slicer to choose which items you want to see.
romovaro
Responsive Resident
3 years agoThanks jgeddes. It works perfectly.
Happy weekend
I have another question in the forum in case you want to have a look.