Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Difference from Previous Column/Date

Hello All!

I am looking for a simple calculation in power bi that I can't seem to figure out. I am looking to get the difference from previous date. I'm not quite sure how to get this to work. I have included a picture of what I would like the end result to be in power bi.  I would like to  calculate the difference from the previous date and dynamically show every 2 days (i.e data for the 4/1/20, 4/3/20, 4/5/20 and so on). I did create a date table and created a relationship to my date column in my data table, but still haven't gotten anything to work.


Any help is appreciated!


Thank you in advance!



excel test file.png

Super User IX
Super User IX

Re: Difference from Previous Column/Date

@Slimage - Please first check if your issue is a common issue listed here:

Also, please see this post regarding How to Get Your Question Answered Quickly:

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Frequent Visitor

Re: Difference from Previous Column/Date

HI @Slimage ,

If I understand your question correctly, You need different with the value from a day -2.

Here I have replicated the scenario. Let me know if it works for you or not.




Value D = SUM('Table'[Value])
VAlue D-2 = CALCULATE(SUM('Table'[Value]),DATEADD('Table'[Date],-2,DAY))
Diff = IF(ISBLANK([VAlue D-2]), BLANK(),[Value D]-[VAlue D-2])
Super User IX
Super User IX

Re: Difference from Previous Column/Date

@Slimage , refer if these measures can help


Last Day Non Continous = CALCULATE(sum('order'[Qty]),filter(all('Date'),'Date'[Date] =MAXX(FILTER(all('Date'),'Date'[Date]<max('Date'[Date])),Table['Date'])))
Day behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Day))
Diff COlumn = datediff(maxx(filter(Table,Table[Date]<earlier(Table[Date]) && Table[Numberf]= earlier(Table[Numberf])  ),Table[Date]) ,Table[Date],Day)

This Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))


To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :

See if my webinar on Time Intelligence can help:

Appreciate your Kudos.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Upcoming Events

Community Summit North America – Join Online!

Join this community-driven Power Platform digital event for unbiased support and problem-solving.

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Top Solution Authors