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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
betterdays
New Member

Using date slicer with parallel period

I would like to achieve the following:

  1. Use a report slicer filter on a month year combination (January 16, February 16, ...)
  2. Show both the Amount for current date filter (month + year) and the Amount for the previous month and the Amount for the same month previous year

I currently use a slicer (date format) with bins per month.

Next to that I have the following Amounts (as a Card):

  • Amount: CALCULATE(SUM('personalfinance banktransactions'[AMOUNT]),FILTER(ALL('personalfinance banktransactions'[DATE]),'personalfinance banktransactions'[DATE]<=MAX('personalfinance banktransactions'[DATE])))
  • Amount Previous Month = calculate(SUM('personalfinance banktransactions'[AMOUNT]), PARALLELPERIOD('personalfinance banktransactions'[DATE].[Date],-1,MONTH),FILTER(ALL('personalfinance banktransactions'[DATE]),'personalfinance banktransactions'[DATE]<=MAX('personalfinance banktransactions'[DATE]) && YEAR ( 'personalfinance banktransactions'[DATE] ) < MAX ( 'personalfinance banktransactions'[CalendarYear] )))
  • Amount Previous Year = calculate(SUM('personalfinance banktransactions'[AMOUNT]), PARALLELPERIOD('personalfinance banktransactions'[DATE].[Date],-12,MONTH),FILTER(ALL('personalfinance banktransactions'[DATE]),'personalfinance banktransactions'[DATE]<=MAX('personalfinance banktransactions'[DATE]) && YEAR ( 'personalfinance banktransactions'[DATE] ) < MAX ( 'personalfinance banktransactions'[CalendarYear] )))

Problem: When I filter on the date (month + year), I do not get results for the Amount previous Month & Amount Previous Year values. How can I fix this?

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@betterdays,

 

You may refer to the .pbix attached.

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.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@betterdays,

 

You may refer to the .pbix attached.

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.

@v-chuncz-msft,

 

I tried PARALLELPERIOD function. it returns blank. Kindly assist me.

 

FYI - I'm using BigQuery tables and it is DirectQuery.

 

Anonymous
Not applicable

This is great for learning how to use dates for comparisons in DAX.  Thanks

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

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.