Forum Discussion

aurelievxx's avatar
aurelievxx
Regular Visitor
2 years ago

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

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity 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.

    • aurelievxx's avatar
      aurelievxx
      Regular Visitor

      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's avatar
    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