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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Data and calculations changing according to date slicer

Hi dear community, 

I have the following situation:

A realtive date slicer is added to my report. As you know it currently has following options:

  • days
  • weeks
  • months
  • years

The goal is to  get a measure and respective vizualization where I can see the comparison between the period from slicer and exact prior period for the slicer choice. 

For example

  • if in the slicer I have last week, I will get the value for last week vs prior week.
  • if in the slicer I have last month, I will get the value for last month vs prior month, etc. 

In short it is about dynamicaly calculated measure which will understand the logic of the slicer and update accordingly. I know and I have created measures like:

PW New Sessions = CALCULATE([new],DATEADD('Calendar'[Date],-7, DAY)) which works only with weeks.

PM New Sessions = CALCULATE([new],DATEADD('Calendar'[Date],-1, Month)) which works only with month.

 

The idea and desired measure is a combination of those where the calculation logic is connected with slicer. 

I have seen this thread, but the link is not working more. @v-shex-msft

 

https://community.powerbi.com/t5/Desktop/Calculated-Column-Table-Change-Dynamically-According-to-Sli...

 

Will be grateful for any advice/information you can share with me.

 

Cheers, 

Saro

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 
Currently, Power bi does not support filtering based on the selected period in Relative fitler. The linked post is not really relevant to your case.

 

As a workaround solution, I would recommend you to create a measure for each time period, and then filter the measures to be displayed on the visual by creating a slicer table. Please see my pbix sample, remember you need to select the period in both slicers.

 

https://qiuyunus-my.sharepoint.com/:u:/g/personal/paul_qiuyunus_onmicrosoft_com/Ecji-DpgpJ9Kif0TF-8byi0B27FIgwonWpZBY7Pyku6UaA?e=AMlvkS

compare current value vs PR value.JPG


Paul Zheng _ Community Support Team
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
Anonymous
Not applicable

@Anonymous 
Currently, Power bi does not support filtering based on the selected period in Relative fitler. The linked post is not really relevant to your case.

 

As a workaround solution, I would recommend you to create a measure for each time period, and then filter the measures to be displayed on the visual by creating a slicer table. Please see my pbix sample, remember you need to select the period in both slicers.

 

https://qiuyunus-my.sharepoint.com/:u:/g/personal/paul_qiuyunus_onmicrosoft_com/Ecji-DpgpJ9Kif0TF-8byi0B27FIgwonWpZBY7Pyku6UaA?e=AMlvkS

compare current value vs PR value.JPG


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you so much!

amitchandak
Super User
Super User

@Anonymous , for slicer, refer :

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

 

For week refer

https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors