Forum Discussion
PhilippMer
4 years agoFrequent Visitor
Dax Function retrieve value from previous entry
Hello, I have come across a problem, and im not able to find the right expression in DAX to solve it so far. I have a Table with Data from a LinkedIn profile, there are over 90 different Posts and ...
- 4 years ago
Sorry my mistake
Previous Day Views = VAR CurrentDate = TableName[LogDate] VAR PostTable = CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[PostText] ) ) VAR PreviousDate = MAXX ( FILTER ( PostTable, TableName[LogDate] < CurrentDate ), TableName[LogDate] ) RETURN MAXX ( FILTER ( PostTable, TableName[LogDate] = PreviousDate ), TableName[PostViews] )
PhilippMer
4 years agoFrequent Visitor
Hi tamerj1
thank you so much for your quick reply. The formula almost works as expected. I think for some reason it takes the Numbers 2 entries from before and not the first entrie before of the current date.
Screenshot:
Do you know why this is happening?
tamerj1
4 years agoCommunity Champion
Sorry my mistake
Previous Day Views =
VAR CurrentDate = TableName[LogDate]
VAR PostTable =
CALCULATETABLE ( TableName, ALLEXCEPT ( TableName, TableName[PostText] ) )
VAR PreviousDate =
MAXX (
FILTER ( PostTable, TableName[LogDate] < CurrentDate ),
TableName[LogDate]
)
RETURN
MAXX (
FILTER ( PostTable, TableName[LogDate] = PreviousDate ),
TableName[PostViews]
)- PhilippMer4 years agoFrequent Visitor
Thank you tamerj1 you saved my day!