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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Yogesh_NMH
Helper I
Helper I

Change the x-axis dynamically

Hello everyone, 

 

I have a slicer for "Period Selection" (Yearly, Quarterly, Monthly, Weekly and Daily).

 

The x-axis on my charts need to change as per the selection made from the slicer as follows:

Yearly -> display Month/Year e.g. Oct 2016, Nov 2016, etc. up to the current month Jun 2016

Quarterly -> display Quarter/Year e.g. Q1 2017, Q2 2017, etc.

Monthly -> same as for Yearly

Weekly -> display Month/Year/Week e.g. May 2017 W1, May 2017 W2, etc.

Daily -> display all dates in the current month e.g. 2017-06-01, 2017-06-02, etc.

 

I have all those dates in my Date Dimension.

 

How do I create the Axis Dimension to reflect the above slicer selection please?

 

Thanks in advance.

 

Kind regards,

Yogesh

1 ACCEPTED SOLUTION

Hi @Yogesh_NMH,

 

Here is an other similar thread which has provided a valid solution to dynamically show X-axis dimension.

 

Dynamic change in X Axis

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
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

10 REPLIES 10
Anonymous
Not applicable

are you able to make it up? I am also looking for dynamic X-axis change based on the time range selection.

theov
Advocate II
Advocate II

Hi, yes basically you need to have an axis table combining your axes and then make inactive relationships with your model and call them in your measures. This video explains this subject thoroughly :https://www.youtube.com/watch?v=DXo7G6PtiYE

vanessafvg
Super User
Super User

@Yogesh_NMH why dont you create a hierarchy?

 

https://powerbi.microsoft.com/en-us/guided-learning/powerbi-learning-3-11g-visual-hierarchies-drilli...





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg For some charts, I will, don't worry. The problem is, I need to reflect this Axis Dimension in several charts & KPI's as well. 

 

I am also using the custom visual found here. So when the user selects Yearly, Quarterly, Monthly, etc, the Trend Axis in the KPI Indicator needs to also change accordingly.

 

Any idea on how to do this?

 

Thanks in advance.

 

Kind regards,

Yogesh

@Yogesh_NMH please post screen shots it really hard to visualise what you saying without providing examples and then also of what you actually wanting it to look like





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg

 

The column chart below uses a Date Hierarchy which enables the user to drill down Year->Quarter->Month->Week->Day. 

 

Date Hierarchy Chart with Drill Down.png

 

However, for the KPI's below, you need to specify a Trend Axis. 

 

KPI Indicator with Trend Axis.png

By default I have used the column MonthInCalendar. However, this axis needs to be dynamic. In simple english:

Trend Axis =

IF Yearly OR Monthly THEN MonthInCalendar

ELSE IF Quarterly THEN QuarterInCalendar 

ELSE IF Daily THEN DateInCalendar

ELSE MonthInCalendar (default)

@Yogesh_NMH never personally done it before but think these 2 links can help

 

http://www.leanx.eu/tutorials/dynamic-dimensions-in-power-bi

https://gqbi.wordpress.com/2017/01/24/power-bi-how-to-filter-slicers-dynamically/

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




@vanessafvg I was looking at those 2 solutions some minutes ago Smiley Happy

Hi @Yogesh_NMH,

 

Here is an other similar thread which has provided a valid solution to dynamically show X-axis dimension.

 

Dynamic change in X Axis

 

Best regards,
Yuliana Gu

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

Hi @v-yulgu-msft

 

Many thanks for your reply. I will give it a try.

 

Kind regards,

Yogesh

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

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.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.