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
Anonymous
Not applicable

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
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 


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

Anonymous
Not applicable

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

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.