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

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

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...

 


@ 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!:
The Definitive Guide to Power Query (M)

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

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/

 

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.