Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 the corresponding amount of Views on every single day. I would like a Column to have the the Value of the amount of Views from the previews day, so that I can make a simple Calculation of how many new Views per day each post had. My table looks like the following:
I tried going through the LogDate with Earlier...but so far had no success. There is no ID only the PostText as a String. Any recommendations on how I could get to the solution?
Thanks in advance!
Solved! Go to Solution.
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]
)
Hi @PhilippMer
please use
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]
)
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?
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]
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 10 |