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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
melg
Frequent Visitor

Parallel Period producing the same result as current period

Hi there,

 

I have created the below expression to populate a line graph. This works perfectly for the current period. 

 

Gross Deals Posted =
SWITCH(
       SELECTEDVALUE('Grouping'[Group]),
          "Posted Deals",
                [Posted Deals 13Months],
          "Posted Gross",
                [Posted Gross 13Months]
)

 

However, when I try to work out the values for the previous period, using parallel period, it does not seem to work. 

 

Gross Posted Deals 1YR =
CALCULATE([Gross Deals Posted],
                PARALLELPERIOD(pavw_Dates[ReportingDate].[Date],
                -12,
                MONTH)
                 )
 
This expression calculates the same value as the current period.
 
melg_2-1634606286031.png

 

I turned this into a table to see more clearly. 

 

melg_3-1634606323328.png

 

Any help would be greatly appreciated. 

Thank you.

Melanie 

 

5 REPLIES 5
mahoneypat
Employee
Employee

Please share your [Posted Deals 13Months] measure.  I suspect that is undoing what you are trying to do with the time intelligence functions.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi there,

 

Posted Deals 13Months =
VAR
LDate = MAX(pavw_Dates[ReportingDate])
VAR
FDate = EOMONTH(LDate,-13)
VAR
Result =
IF(
MAX(FilterDates[ReportingDate]) <=
LDate &&
MIN(FilterDates[ReportingDate]) >=
FDate,
CALCULATE(
[Posted Deals],
FILTER(ALL(pavw_Dates[MonYear]),
pavw_Dates[MonYear] =
VALUES(FilterDates[MonYear])
)
)
)
RETURN
Result
 
 
The reason I did this was to be able to show 13 months on the graph, no matter what month was selected in the slicer. This date slicer is using the pavw_Dates table.
 
Also as part of this process, I created another date table called FilterDates:
FilterDates = pavw_Dates
 
This was so the graph would work correctly showing the 13 months, so in my Axis, I have the MonthYear from the FilterDates table.
 
I hope that makes sense.
 
Thanks. 
 
amitchandak
Super User
Super User

@melg , You should use Date table for that

 

Gross Posted Deals 1YR =
CALCULATE([Gross Deals Posted],
SAMEPERIODLASTYEAR('Date'[Date],
-12,
MONTH)
)

or

Gross Posted Deals 1YR =
CALCULATE([Gross Deals Posted],
SAMEPERIODLASTYEAR('Date'[Date])
)

or

Gross Posted Deals 1YR =
CALCULATE([Gross Deals Posted],
dateadd('Date'[Date],
-12,
MONTH)
)

 

Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw

Hi there, thank you for your response!

I tried both the SAMEPERIODLAST YEAR and DATEADD and it produces the same result, however this time there is only a value populating for October....

 

I am using ReportingDate from my date table called pavw_Dates.

 

melg_0-1634609615839.png

 

Thanks. 

@melg , Use date table, that is marked as date table, to make time intelligence work.

 

I also see a role of an independent table here. As you are displaying 12 month , when one month is selected 

 

 

refer

Why Time Intelligence Fails - Power bi 5 Savior Steps for TI: https://youtu.be/OBf0rjpp5Hw

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.