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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
BJankic
Helper I
Helper I

Dynamic Date Axis Based on Period Slicer (Day, Week, Month Granularity)

Hi,

I'm working on a report where I want to dynamically change both the time frame logic and the X-axis granularity based on a user-selected period from a slicer. Link to the file: Sample 

 

I have a slicer with the following period options (from a disconnected table PeriodTable[Period]):

  • MTD vs. Last Year MTD → show by days

  • QTD vs. Last Year QTD → show by weeks

  • Current YTD vs. Prior YTD → show by weeks

  • Rolling 90 days → show by weeks

  • Rolling 12 Months → show by months

My goal is to:

  • Use one line chart that dynamically adapts its X-axis to show the right level of date granularity based on the selected period

  • Display two measures:

    • Current Period (CurrentPeriod)

    • Same Period Last Year (SamePeriodLastYear)

  • Use a dynamic table (Date_Period) for the axis, which adjusts to day/week/month with proper labels and sorting

24 REPLIES 24

Hi @V-yubandi-msft , I’ve now allowed access to everyone with the link. However, this is not the solution I’m looking for.

Power BI does not currently allow you to dynamically change the X-axis granularity (such as day, week, or month) and values directly through a slicer. As an alternative, you can use bookmarks to switch between visuals with set granularities, though this approach may not provide complete dynamic axis control.

Thanks&regards,
Yugandhar.

BJankic
Helper I
Helper I

Thank you @lbendlin for sharing the link. However, I would like to see a real solution based on the use case I provided. First, there is no date slicer, the calculation should be based on the selected timeframe. Also, how would you capture the Rolling 12 Months vs Rolling 12 Months Prior Year?

lbendlin
Super User
Super User

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Users online (19,342)