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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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