Forum Discussion
Comparing Dates (Slippage) vs current Go Live Date Month
- 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")
I am not sure that I 100% understand the outcome you are looking for but
I created a small dataset based on your example as follows
Using that data I made the following measure
Hope this helps.
Thanks jgeddes,
Thanks for your answer. That looks good. I see that you combined all dates column in one column called period.
The thing is that every month I will get the excel file like the one below:
One column with dates for every month.
Tried different ways to Merge/Group to move all dates in one column based on CUID and create your "period column" but it seems I am unable to do it.
- jgeddes4 years ago
Super User
In the format you have you will need to unpivot the columns in Power Query and then you will be able to add the Period column. The period column I created was just done with DAX. FORMAT(gldTable[Period[, "YYYY-MM")
- romovaro4 years ago
Responsive Resident
Thanks for the Help. I unpivoted the columns in Power Query I created the columns like your screenshot.
but is not working.
It says something about Dax comparison operations do not support comparing values of type Date with Text values but I updated all the fileds involved to Date format.
Attached a report in case it helps.
- jgeddes4 years ago
Super User
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"))
- romovaro3 years ago
Responsive Resident
hi @jgeddes,
Quick question regarding this report
As discussed previously, my data source is the Excel below.
Report is monthly and "Actual GOLIVE" column always uses the most updated go Live Date in the file. (see example below). That means that I cannot use the "Actual Go live Data columns" as the "Original Go Live Date"
Is it possible to create a measure that takes the earliest date (that we can use as the Original Go Live Date) and compare with the changes?
Tried
Earliest GLD = MIN(RPT10[GLD]) but it's showing the same data as the month date.For example first Row (CUID 380305KR01)
Original Go Live Date should be: Jun-2022
Same date for CUID 380305MX01
thanks
- jgeddes3 years ago
Super User
CALCULATE(
MIN(RPT10[GLD]),
ALLEXCEPT(RPT10, RPT[CUID])
)should pull the earliest date for each CUID