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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
bvanderwatt
Helper III
Helper III

Comparing performance (only completed days)

Good Day 

 

I am trying to compare this year's performance to last years performance. 

 

My data is live and therefore it's skewing my results as it's compare a full day last year to a non-completed day this year (Depending on the time of the day I update my data.) 

 

How can I amend the below formulas to only include only up until yesterday for both measures? Ideally I want the measure to only take into account "completed" days. 

 

THIS YEAR'S FORMULA:

MTD NSls TY (Incl today) =
CALCULATE(
'Combined Sales'[Sum of Inv+Order],
DATESMTD('Calendar'[Date]
)
)
 
LAST YEAR'S FORMULA:
MTD NSls LY (Incl today) =
VAR _TODAY = TODAY()
VAR _LY = EDATE(_TODAY,-12)
RETURN
CALCULATE(
'Combined Sales'[Sum of Inv+Order],
SAMEPERIODLASTYEAR('Calendar'[Date]),
'Calendar'[Date] <= _LY
)
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could try

MTD NSls TY (Incl today) =
CALCULATE(
'Combined Sales'[Sum of Inv+Order],
DATESMTD('Calendar'[Date],
'Calendar'[Date] < TODAY()
)
)
 
MTD NSls LY (Incl today) =
VAR _TODAY = TODAY()
var endLastYear = EDATE(_TODAY,-12) -1
var startLastYear = EOMONTH( _TODAY, -13) + 1
RETURN
CALCULATE(
'Combined Sales'[Sum of Inv+Order],
DATESBETWEEN( 'Calendar'[Date], startLastYear, endLastYear)
)

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

You could try

MTD NSls TY (Incl today) =
CALCULATE(
'Combined Sales'[Sum of Inv+Order],
DATESMTD('Calendar'[Date],
'Calendar'[Date] < TODAY()
)
)
 
MTD NSls LY (Incl today) =
VAR _TODAY = TODAY()
var endLastYear = EDATE(_TODAY,-12) -1
var startLastYear = EOMONTH( _TODAY, -13) + 1
RETURN
CALCULATE(
'Combined Sales'[Sum of Inv+Order],
DATESBETWEEN( 'Calendar'[Date], startLastYear, endLastYear)
)

Hi John 

 

How could I amend the formula for this year to not be dependent on my date slicer? 

 

The formula only works if I add the date slicer. 

 

However, the formula for the previous year is not dependent on my date slicer. 

You could try

MTD NSls TY (Incl today) =
CALCULATE(
'Combined Sales'[Sum of Inv+Order],
DATESBETWEEN('Calendar'[Date], DATE( YEAR(TODAY()), MONTH(TODAY()), 1), TODAY())
)

Thank you very much. 

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.

Top Solution Authors