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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
BYENER
Helper V
Helper V

Show difference between last two selected dates

Hi,

 

I want to show the difference between the last two selected dates (adjustable with slicer). For example if my slicer starts with 19/07 and ends with 23/07 than I want to see the difference between 22/7 and 23/7.

 

date,count column

19/07 100

20/07 500

21/07 450

22/07 870

23/07 200

 

Measure have to return = 200 - 870 = - 670

 

I tried the followning measure, but it was not succesful

 

var MinDate = calculate(count(column), filter(date, min(date.date))

var MaxDate = calculate(count(column), filter(date, max(date.date))

 

returm = MaxDate - MinDate

 

Who can help me?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@BYENER , Try like

measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = _max -1
return
calculate(sum(Table[Value]), filter(Table,Table[date]=_max)) -calculate(Sum(Table[Value]), filter(Table,Table[date]=_min))


measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = _max -1
return
calculate(sum(Table[Value]), filter(Date,Date[date]=_max)) -calculate(Sum(Table[Value]), filter(Date,Date[date]=_min))

 

refer,Power BI — Day Intelligence Questions — Time Intelligence 5–5
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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@BYENER , Try like

measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = _max -1
return
calculate(sum(Table[Value]), filter(Table,Table[date]=_max)) -calculate(Sum(Table[Value]), filter(Table,Table[date]=_min))


measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = _max -1
return
calculate(sum(Table[Value]), filter(Date,Date[date]=_max)) -calculate(Sum(Table[Value]), filter(Date,Date[date]=_min))

 

refer,Power BI — Day Intelligence Questions — Time Intelligence 5–5
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

@amitchandak  thanks a lot, it's working!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.