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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
aurelievxx
Regular Visitor

Dynamic X-Axis with slicer based on another column

Hello,

I'm working on a Power BI report where I need to dynamically change the x-axis of a visual between 'ordre' and 'Cycle' based on slicer selections which is based on another colmn "fond_sec".

I've tried using measures directly on the x-axis, but it seems there are limitations with SELECTEDVALUE. I've also explored creating calculated columns and measures, but I'm still unable to achieve the desired dynamic behavior. Any guidance or alternative approaches would be greatly appreciated.

 

Thanks 🙂

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @aurelievxx 

 

Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.

 

Best Regards,

Community Support Team _Charlotte

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

Hello @v-zhangti ,

 

Thanks so much for your answer.

I can't seem to attach the data in xlsx or pbix. let me know how I can share it best.

 

Here is what it looks like in a screenshot.

I would like to show ordre when the slicer is not selected, and cycle when it is. I can't create a column depending on "fondamental" and "secondaire" (eg: if fond_sec in "fondamental" or "secondaire" then cycle else ordre) because I want it to show ordre if nothing is selected, hence for secondaire and fondamental.

I tried with a measure wirh "HASONEFILTER" or "ISFILTERED" - the measure works well but can't be used as an X-Axis, so I am a bit stuck.

 

Thank you for your help,

 

Aurélie

aurelievxx_0-1698395606630.png

aurelievxx_1-1698395854501.png

 

aurelievxx
Regular Visitor

Just to add a little detail, i thought about using a bookmark but I also have a second slicer to select the year, and if I use a bookmark it always resets the year selected on the second slicer which is a problem.

 

Thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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