Calculate prior month sales without a Date table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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