Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
DiegoSRNA
Frequent Visitor

DAX Evolution Measure

Hi all,

i need some help on my DAX formula because i don't know how to implement it.

I have differents row sales value split by dates:

DateValue
04/02/202220
05/02/202221
06/02/202225

 

What I need is to calculate the evolution of that record, comparing the value of the specific record with the value of that record 6 (or n) days ago.
For example:
Today (04-02-2022), I have 20 sales for this date, but when I checked on 02-02-2022 how the sales were for 04-02-2022, I had 15 sales. Therefore the evolution are +5.

 

Anyone did something like this before ?

Thanks in advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @DiegoSRNA 

You can create a measure to return the value of N days ago . In the below formula , -2 means 2 days ago.

N days ago = CALCULATE(MAX('Table'[Value]),DATEADD('Table'[Date],-2,DAY))

Then create a measure to count the diff between the specific day and N days ago .

diff = SELECTEDVALUE('Table'[Value])-CALCULATE(MAX('Table'[Value]),DATEADD('Table'[Date],-2,DAY))

The final result is as shown :

Ailsamsft_0-1644978003908.pngAilsamsft_1-1644978003911.png

I have attached my pbix file , you can refer to it .

 

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @DiegoSRNA 

You can create a measure to return the value of N days ago . In the below formula , -2 means 2 days ago.

N days ago = CALCULATE(MAX('Table'[Value]),DATEADD('Table'[Date],-2,DAY))

Then create a measure to count the diff between the specific day and N days ago .

diff = SELECTEDVALUE('Table'[Value])-CALCULATE(MAX('Table'[Value]),DATEADD('Table'[Date],-2,DAY))

The final result is as shown :

Ailsamsft_0-1644978003908.pngAilsamsft_1-1644978003911.png

I have attached my pbix file , you can refer to it .

 

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@DiegoSRNA , are planning to select 2 dates in the slicer and then filter

Then refer

How to use two Date/Period slicers

https://youtu.be/WSeZr_-MiTg

 

 

OR you want a new column, diff from the last date 

 

Also check

 

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @Amit,

i don't think that this would work for me. I need to compare the value for the specific date with the value before and calculate the difference.

 

Or myabe i did no understand the example

@DiegoSRNA , assume you need a column to show the value on last date and take a diff

 

new column =

var _max = maxx(filter(Table, [Date]< earlier([DAte]) , [Date])

return

[value] - maxx(filter(Table, [Date]=_max) , [value]) 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.