Forum Discussion
Anonymous
7 years agoNot applicable
parallelperiod does not work for me
Hi all,
I struggeling with parallel period:
i want to get the total sales of previous month, this is the formula I use:
sales previous month = CALCULATE([Sum of sales]; PARALLELPERIOD('Sales Warranty'[timeperiod date]; -1; MONTH))
if I use this formula, i get the total sales of all months also previous years except the sales of this month.
How can I get only the sales of last month?
can you guys help me?
3 Replies
- v-yulgu-msftMicrosoft Employee
Hi Anonymous ,
Make you used a calendar table which contains continuous dates. For more details, please refer to this blog.
DateAdd vs ParallelPeriod vs SamePeriodLastYear; DAX Time Intelligence Question
Best regards,
Yuliana Gu
- AnonymousNot applicable
Hi v-yulgu-msft,
I use a date table created with this query:
Dates = var BaseCalendar = CALENDARAUTO()RETURN GENERATE(BaseCalendar; var Basedate = [Date] var Yeardate = YEAR( Basedate) var monthnumber = MONTH(Basedate)Return row("day"; Basedate = [Date];"Year"; Yeardate;"Month Number"; monthnumber;"Month"; FORMAT ( Basedate; "mmmm" );"Year Month"; FORMAT ( Basedate; "yy mmm" )))BR,Maxim - AnonymousNot applicable