Reply
avatar user
Anonymous
Not applicable
Partially syndicated - Outbound

Parallelperiod issue

Hi all! 

 

I'm trying to get the sales value of the previous previous month but i'm not been able to reach it using parallelperiod formula. 

 
(CALCULATE(Consolidado[TO]; PARALLELPERIOD(Consolidado[Fecha creacion];-2;MONTH)));0))
 
My "Fecha creación" table is:
 
SOP baseIDFecha creación
Actual031/1/2015
SOP 01-Ene231/1/2016
SOP 02-Feb429/2/2016
SOP 03-Mar631/3/2016
SOP 04-Abr830/4/2016
SOP 05-May1031/5/2016
SOP 06-Jun1230/6/2016
SOP 07-Jul1431/7/2016
SOP 08-Aug1631/8/2016
SOP 09-Sep1830/9/2016
SOP 10-Oct2031/10/2016
SOP 11-Nov2230/11/2016
SOP 12-Dic2431/12/2016

 

Now we are working in March, so I must get January value. The weird thing is that if I want to get February value, it works fine using "-1".

 

Thanks for your help

 

3 REPLIES 3
avatar user
Anonymous
Not applicable

Syndicated - Outbound

The dates argument can be any of the following:

  • A reference to a date/time column. Only in this case, a context transition applies because the <Dates> column reference is replaced by
    • CALCULATETABLE  ( DISTINCT  ( <Dates> ) )
  • A table expression that returns a single column of date/time values.
  • A Boolean expression that defines a single-column table of date/time values.

This function takes the current set of dates in the column specified by Dates, shifts the first date and the last date the specified number of intervals, and then returns all contiguous dates between the two shifted dates. If the interval is a partial range of month, quarter, or year then any partial months in the result are also filled out to complete the entire interval.

The result table includes only dates that exist in the dates column.

 

Greg_Deckler
Super User
Super User

Syndicated - Outbound

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

Syndicated - Outbound

Create a date dimension and try trailing period

CALCULATE(Consolidado[TO]; dateadd(Date[Date];-2;MONTH))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)