Skip to content

Instantly share code, notes, and snippets.

@aabundez
Last active November 22, 2019 16:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Calculate prior month sales without a Date table
Revenue PM =
var prior_month_start_date = EOMONTH( MIN ( Sales[Date] ), -2 ) + 1
var prior_month_end_date = EOMONTH( MIN ( Sales[Date] ), -1 ) + 1
RETURN
CALCULATE(
SUM ( Sales[Revenue] ),
FILTER (
ALLSELECTED ( Sales ),
Sales[Date] >= prior_month_start_date && Sales[Date] < prior_month_end_date
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment