cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Noak Helper IV
Helper IV

Parallel period data by selected dates

Hi Guys,

can someone help me with getting sum of value of parallel period while using date filter?.

 

I tried to use the #parallel_period function but I think the Date filttering influnce it.

 

current table:

Untitled.png

 I would like to add lParallel_Period_total (last year) column to my matrix.

BR,
Noa.
1 ACCEPTED SOLUTION

Accepted Solutions
Veles Advocate IV
Advocate IV

Re: Parallel period data by selected dates

You could use a calculated measure like this:

 

Parallel Period = 
VAR MinDate = MIN ( Date[Column] )
VAR StartDate = DATE ( YEAR ( MinDate ) - 1, MONTH ( MinDate ), DAY ( MinDate ) )
VAR MaxDate = MAX ( Date[Column] )
VAR EndDate = DATE ( YEAR ( MaxDate ) - 1, MONTH ( MaxDate ), DAY ( MaxDate ) )
RETURN
CALCULATE ( 
	[Measure],
	FILTER ( 
		ALL ( DateColumn/Table ),
		Date[Column] >= StartDate
			&& Date[Column] <= EndDate
	)
)

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: Parallel period data by selected dates

@Noak,

 

Check if the following link helps.

https://www.sqlbi.com/articles/compare-equivalent-periods-in-dax/

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Veles Advocate IV
Advocate IV

Re: Parallel period data by selected dates

You could use a calculated measure like this:

 

Parallel Period = 
VAR MinDate = MIN ( Date[Column] )
VAR StartDate = DATE ( YEAR ( MinDate ) - 1, MONTH ( MinDate ), DAY ( MinDate ) )
VAR MaxDate = MAX ( Date[Column] )
VAR EndDate = DATE ( YEAR ( MaxDate ) - 1, MONTH ( MaxDate ), DAY ( MaxDate ) )
RETURN
CALCULATE ( 
	[Measure],
	FILTER ( 
		ALL ( DateColumn/Table ),
		Date[Column] >= StartDate
			&& Date[Column] <= EndDate
	)
)

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors