Forum Discussion
brunomoriya
8 years agoHelper I
Repeat last date for each row
Hello everyone, As you can see, i need a calculated column, that repeats the last date whenever the value between "Total Left" and "Amount Left Day Before" doesnt change, and if i get a differenc...
- 8 years ago
here is a dax calculated column
Column = VAR Dif = Table1[Total Left] - Table1[Amount Left Day Before] VAR previousrow = TOPN ( 1, FILTER ( Table1, Table1[Product] = EARLIER ( Table1[Product] ) && Table1[Date] < EARLIER ( Table1[Date] ) && ( Table1[Total Left] - Table1[Amount Left Day Before] ) <> 0 ), [Date], DESC ) RETURN IF ( Dif = 0, MINX ( previousrow, [Date] ), Table1[Date] )
Zubair_Muhammad
8 years agoCommunity Champion
here is a dax calculated column
Column =
VAR Dif = Table1[Total Left] - Table1[Amount Left Day Before]
VAR previousrow =
TOPN (
1,
FILTER (
Table1,
Table1[Product] = EARLIER ( Table1[Product] )
&& Table1[Date] < EARLIER ( Table1[Date] )
&& ( Table1[Total Left] - Table1[Amount Left Day Before] )
<> 0
),
[Date], DESC
)
RETURN
IF ( Dif = 0, MINX ( previousrow, [Date] ), Table1[Date] )brunomoriya
8 years agoHelper I
Thanks a lot !! This worked !!
Thanks for helping, but a dax solution is a better way for me!!