cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alitwaij Frequent Visitor
Frequent Visitor

Dynamic chart axes via parameter or switch

Hi I watched partrick's dynamic axes video and wondered why we can do it using a DAX formula that has a switch on it based on a value from a table or parameter.

https://www.youtube.com/watch?v=n-OWNaCUU0o

 

It would make a big improvement to power bi. This is what i commented on his video:

 

Hi Patrick my friend, i tried creating a dax var with IF(selectedValue(Test[Value])=1,Format(DateCol,"MMM"),ProductType) and stuck that into the x-axis of a bar chart and unfortunately even though the code was sound (no errors) the switching didnt work. Test is a table with values 0 and 1 only and was using it to switch axes. If MS can get this working it would be great i think.
 
 
 
 
2 REPLIES 2
Community Support Team
Community Support Team

Re: Dynamic chart axes via parameter or switch

@alitwaij ,

 


IF(selectedValue(Test[Value])=1,Format(DateCol,"MMM"),ProductType) and stuck that into the x-axis of a bar chart and unfortunately even though the code was sound (no errors) the switching didnt work. Test is a table with values 0 and 1 only and was using it to switch axes. If MS can get this working it would be great i think.

I'm not very clear about your description, how can you drag the measure to the X-axis bar chart?

 

Regards,

Jimmy Tao

alitwaij Frequent Visitor
Frequent Visitor

Re: Dynamic chart axes via parameter or switch

By putting it into the Axis bin just above the Legend bin. Simple

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 388 members 3,255 guests
Please welcome our newest community members: