Forum Discussion
Anonymous
6 years agoNot applicable
How to persist a column over time?
Product Market Date Value Required Column P1 M1 Nov-19 1 1 P1 M1 Dec-19 1 P1 M1 Jan-20 1 P2 M1 Oct-19 P2 M1 Nov-19 P2 M1 Dec-19 1 1 ...
- 6 years ago
See attached PBIX. One, you need an actual Date column. Two, I can't tell what your dates are, is Nov-19 11/1/2019 or 11/19/????
Assuming the first, you have an issue in your data where you have September 2020 as not a 1 so maybe it is the other way? Difficult to tell.
Anyway, see attached and let me know.
Anonymous
6 years agoNot applicable
I've just checked the supplied code and it confirms my own (below)
Could it be that your dates are out of order (for instance you have sep 2020 before nov-2019?
Column =
var lastDateOne = maxx(
filter('Table (2)',
'Table (2)'[Product]=EARLIER('Table (2)'[Product]) &&
'Table (2)'[Market]=earlier('Table (2)'[Market]) &&
'Table (2)'[Value]=1)
,'Table (2)'[Date])
var showOne = if(
and('Table (2)'[Date]>=lastDateOne,not(isblank(lastDateOne))),1,blank())
return showOne