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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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

 



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

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/

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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