Forum Discussion

AnZee's avatar
AnZee
Frequent Visitor
1 year ago
Solved

Dynamic y-axis scaling based on date selection in Power BI Dashboard

Hello everyone,

I am working on a Power BI dashboard where I need to dynamically adjust the y-axis scale of a Visual based on the selected date range. The goal is to ensure that consecutive date selections (e.g., 1 day, 1 week, etc.) maintain a consistent y-axis range for easy comparison.

For example:

When a single date is selected, the y-axis should reflect values for that selection while keeping the scale consistent across different date selections.
If a user changes the date selection (e.g., from 1 day to 1 week), the y-axis range should adjust accordingly but still allow for meaningful comparison between different time periods.
Question:
Is there a way to control y-axis scaling dynamically while ensuring that different date selections remain comparable?
Are there any best practices or workarounds others have used for a similar scenario?

  • In the y axis properties you can define a min and max range. This can be hard coded values, or if you select FX next to the input box, by a measure.

     

    You could use something like

     

    MaxAxis =

    calculate( 

    [Measure on y axis],

    Removefilters( calendar )

    )

4 Replies

  • Deku's avatar
    Deku
    Icon for Super User rankSuper User

    In the y axis properties you can define a min and max range. This can be hard coded values, or if you select FX next to the input box, by a measure.

     

    You could use something like

     

    MaxAxis =

    calculate( 

    [Measure on y axis],

    Removefilters( calendar )

    )

  • v-menakakota's avatar
    v-menakakota
    Icon for Community Support rankCommunity Support

    Hi AnZee ,

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.

    • v-menakakota's avatar
      v-menakakota
      Icon for Community Support rankCommunity Support

      Hi AnZee ,

      I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

      Thank you.

      • v-menakakota's avatar
        v-menakakota
        Icon for Community Support rankCommunity Support

        Hi AnZee ,

        I hope the provided  information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

        Thank you