Forum Discussion
Dax Sales by Period
Hi Ricardo,
Please give it a try with below measures.
Sales 31 to 60 Days =
var ld = CALCULATE ( MAX ( dCalendar[Date] ), ALLSELECTED ( dCalendar[Date] ))
var sd = ld-30
return
CALCULATE([Sum Sales], DATESBETWEEN(dCalendar[Date],sd,ld))
Sales 1 to 30 Days =
var ld = CALCULATE ( MAX ( dCalendar[Date] ), ALLSELECTED ( dCalendar[Date] ))
var sd = ld-60
var lp = sd + 30
return
CALCULATE([Sum Sales], DATESBETWEEN(dCalendar[Date],sd,lp))
let me know if it works
Hello,
Thanks for returning, I tested the formulas sent, but the values disappear when the formula is applied.
Regards
- Washivale8 years ago
Resolver V
Hi Ricardo,
When you say 01 to 30 days out of 60, should we be looking at 60 days prior from today's date , or 60 days prior to the last date on your table.
Also, Do you have a date slicer on your report, last formula i sent will work on the dynamic date selections (if you could add a date slicer and select date from which backdated calculation should happen, it would return values.)
Thanks