Forum Discussion

topazz11's avatar
topazz11
Helper III
8 months ago
Solved

Help in limiting the X-axis per value

I want to draw a line that represents the allowed limit for each level and display each item's value relative to that range. For example, Level 1 would show a limit of ±50, Level 2 would show ±30, and Level 3 would show ±10. Each item should appear on the chart along with its corresponding limit line.


Is there a way to achieve this?

Thanks for your help!

 

 

Levelitem 1item 2item 3item 4
Level 1 (+/-50)-1508010040
Level 2 (+/-30)50-203060
Level 3 (+/-10)2050515

  • Hi topazz11 

    Sample data: 

    Create Two Additional measure: 

    Upper Limit = 
    VAR CurrentLevel = SELECTEDVALUE(data[Level])
    RETURN
        SWITCH(
            CurrentLevel,
            "Level 1", 50,
            "Level 2", 30,
            "Level 3", 10,
            BLANK()
        )
    
    Lower Limit = 
    VAR CurrentLevel = SELECTEDVALUE(data[Level])
    RETURN
        SWITCH(
            CurrentLevel,
            "Level 1", -50,
            "Level 2", -30,
            "Level 3", -10,
            BLANK()
        )

     

    Results: With a line chart 

    x-axis: Item

    Y-axis = value, Upper Limit, Lower Limit 

    Small multiple: Level 

    File: https://drive.google.com/file/d/1UvQLP7hJxIJQ8d8lJXtflZQdBFlVWn1E/view?usp=sharing 

    Note: If you like to keep only one visual at a time use a slicer where the default selected value is any level. 


    Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!

    I’d love to stay connected. Join me on LinkedIn for more tips, learning paths, and real-world Fabric & Power BI solutions.

     

     

     

4 Replies

  • Hi topazz11 

    Sample data: 

    Create Two Additional measure: 

    Upper Limit = 
    VAR CurrentLevel = SELECTEDVALUE(data[Level])
    RETURN
        SWITCH(
            CurrentLevel,
            "Level 1", 50,
            "Level 2", 30,
            "Level 3", 10,
            BLANK()
        )
    
    Lower Limit = 
    VAR CurrentLevel = SELECTEDVALUE(data[Level])
    RETURN
        SWITCH(
            CurrentLevel,
            "Level 1", -50,
            "Level 2", -30,
            "Level 3", -10,
            BLANK()
        )

     

    Results: With a line chart 

    x-axis: Item

    Y-axis = value, Upper Limit, Lower Limit 

    Small multiple: Level 

    File: https://drive.google.com/file/d/1UvQLP7hJxIJQ8d8lJXtflZQdBFlVWn1E/view?usp=sharing 

    Note: If you like to keep only one visual at a time use a slicer where the default selected value is any level. 


    Find this helpful? ✔ Give a Kudo • Mark as Solution – help others too!

    I’d love to stay connected. Join me on LinkedIn for more tips, learning paths, and real-world Fabric & Power BI solutions.

     

     

     

  • hi topazz11 

    In your expected result, where are those dots coming from? I only see three, but your sample data contains twelve.

     

  • v-tejrama's avatar
    v-tejrama
    Community Support

    Hi topazz11 ,

     

    Thank you Royel  for the response provided!

     

    Has your issue been resolved? If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

    Thank you.

    • v-tejrama's avatar
      v-tejrama
      Community Support

      Hi topazz11 ,

       

      I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.

       

      Thank you.