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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Marko33
Frequent Visitor

Dynamic Column selection DAX

Hi,

 

I´m trying to change the axis of a line visual with kind of a dynamic column which is selectable through a slicer by users.

 

The dax formula looks like this:

 

CLNDR_or_FISCAL_Month_Name = IF(CalendarDIM[Selected Calendar]=2 ,DateDIM[01_CLNDR_MO_NM],DateDIM[01_FSCL_MO_NM])
 
So basically the users is selecting if he wants to see fiscal month or calendar month. Unfortunately, PBI selects always the "false" result, even the right result should be displayed? Any idea why?
 
Thanks,
Marko
3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @Marko33 ,

 

Looking at your needs, I think the following similar solutions seem to be able to help you. If there is still a problem, please point it out and I will answer it for you.

 

Solved: Dynamic change in X Axis - Microsoft Power BI Community


Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Marko33
Frequent Visitor

Thanks for the fast answer! Is there any explanation why this approach with selected value doesn´t work with axis but is does for other measures?

 

Thanks,
Marko

amitchandak
Super User
Super User

@Marko33 , for that you need to use bookmarks, Unpivot column.

 

 

 

Dynamically change chart axis in Power BI
bookmark -https://blog.crossjoin.co.uk/2018/04/20/dynamically-changing-a-chart-axis-in-power-bi-using-bookmarks-and-buttons/
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
https://www.youtube.com/watch?v=6jeSIRpjv0M

 

There is a different option in direct query
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.