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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BJankic
Helper II
Helper II

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 II
Helper II

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
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
Top Kudoed Authors