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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
gescobarmaya
Frequent Visitor

Difference between today values (granulated by minutes) and the last or max of yesterday´s values

Hi everyone,

I´ve been trying to get the difference between the current (today) values that are granulated by minutes, and the last or max of yesterday´s value. I tried this with no results:

 

VALUE_Dif D-1 =
var _Max=Max(DataTable[Value])
var ValueD_1= CALCULATE(_Max, DATEADD(TableDate[Date], -1, DAY))
return
[VALUE]-ValueD_1
 
[Value] is the average of the DataTable[Value] to avoid summarize 
 
Does someone know what´s is missing? 
 
2021-02-18 (2).png

 

 

5 REPLIES 5
jameszhang0805
Resolver IV
Resolver IV

hi would you please try this.  change the caclulate expression in var ValueD_1 from a variable to Max(DataTable[Value])

Thank you James, but I tried before and I can't introduce the MAX function in CALCULATE.  

This message appears me when I try to do that: "A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed."

use topn function to calculate the max value table and put it into calculate filter. the calculate expression. please change to values(DataTable[Value)

Diff Testing 
Added the pbix file , please check 

Nope. There is the thing. Like I said, the values are granulated by minutes. I´m not able to bring the last value of D-1 to today´s values to calculate the difference. My D-1 calc is only bringing me the value for the same hour that the day before 😅, and I need it for every value for any time of the current day.2021-02-18 (2).png

 The time of every value is only for demonstrative purposes and it changes every day.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.