cancel
Showing results for
Did you mean:

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

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
Community Support

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.
3 REPLIES 3
Community Support

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

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

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors