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
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
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.