Forum Discussion
maico_presente
6 years agoRegular Visitor
Date Value from previous record
Hello, I've been working on a problem for hours and can't get any further! HELP ;-)) I have a list of users who belong to a group from a certain date. If a user is moved to another group i h...
- Anonymous6 years ago
You would need to add an index column in power query that allows you to look at the value from the previous row.
date_to = VAR currentindex = 'Table'[Index] VAR lastrowdate = CALCULATE ( MAX ( 'Table'[date_from] ), ALLEXCEPT ( 'Table', 'Table'[user_number] ), FILTER ( 'Table', 'Table'[Index] = currentindex + 1 ) ) RETURN IF ( [date_from] = CALCULATE ( MAX ( [date_from] ), ALLEXCEPT ( 'Table', 'Table'[user_number] ) ), TODAY (), lastrowdate - 1 )
Sample pbix: https://microsoftapc-my.sharepoint.com/:u:/g/personal/v-pazhen_microsoft_com/EUYxhep3tNpGk3Tinz6bPQQBCd2XSWMnxsAd6NjknWGdBQ?e=UZd1uX
Paul
Best
Anonymous
6 years agoNot applicable
You would need to add an index column in power query that allows you to look at the value from the previous row.
date_to =
VAR currentindex = 'Table'[Index]
VAR lastrowdate =
CALCULATE (
MAX ( 'Table'[date_from] ),
ALLEXCEPT ( 'Table', 'Table'[user_number] ),
FILTER ( 'Table', 'Table'[Index] = currentindex + 1 )
)
RETURN
IF (
[date_from]
= CALCULATE ( MAX ( [date_from] ), ALLEXCEPT ( 'Table', 'Table'[user_number] ) ),
TODAY (),
lastrowdate - 1
)
Sample pbix: https://microsoftapc-my.sharepoint.com/:u:/g/personal/v-pazhen_microsoft_com/EUYxhep3tNpGk3Tinz6bPQQBCd2XSWMnxsAd6NjknWGdBQ?e=UZd1uX
Paul
Best
maico_presente
6 years agoRegular Visitor
Anonymous
Fantastic!!! Thank you sooooo much!!!