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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not 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 3
v-yulgu-msft
Employee
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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yulgu-msft 

 

can you help please? 

Anonymous
Not 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
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.