Forum Discussion

Dunner2020's avatar
Dunner2020
Post Prodigy
5 years ago
Solved

Shading area between two lines

Hi there,

 

I am plotting three lines on a line graph. One is the actual value, the other is the upper limit and the last one is lower limit. Now I want to colour/shade the area between upper and lower limit lines something similar to how we show the confidence interval in forecasting. I sketched my desired output in the following picture:

 

Is there way of doing that in Power BI?

 

9 Replies

  • Dunner2020 

    I've figured out a workaround. Use the Power KPI Custom Visual: https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa104381083?tab=overview 

     

    You want to use the top and bottom lines as Area and turn Area Opacity to 100. For the minimum line, choose white (or whatever your background color is) and for the maximum line, choose whatever you want your area color to be. 

    Then, I'd turn off the Y Axis Reference Lines, so that the lines in the background don't show up. The result should look something like this:

    In this example, I've added an average line and a regular line. If you need help with that, let me know.

     

    • v-deddai1-msft's avatar
      v-deddai1-msft
      Community Support

      Hi kirbynguyen ,

       

      Would you please show us sample pbix file? Thank you for support.

       

      Best Regards,

      Dedmon Dai

  • v-deddai1-msft's avatar
    v-deddai1-msft
    Community Support

    Hi Dunner2020 ļ¼Œ

     

    Unfortunately, I haven't found any custom viusal which can achieved it. As a workaround, you can use stacked area chart. Change the color for actual value and upper limit to the same color and change the color for lower limit to your background color(my background color is white) . Change the stroke width to 0:

     

     

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

     

    Best Regards,

    Dedmon Dai

     

     

    • Dunner2020's avatar
      Dunner2020
      Post Prodigy

      v-deddai1-msft , thanks for reply. The problem is that I also want to show the actual value-line graph. Moreover, I want to show the graph as shown in the following figure:

       

       

      Is there anyway of doing that in power BI?

      • v-deddai1-msft's avatar
        v-deddai1-msft
        Community Support

        Hi Dunner2020 ,

         

        It seems to be impossible to achieve in Power BI now. I didn't find any custom visual for it.

         

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

         

        Best Regards,

        Dedmon Dai

      • mahoneypat's avatar
        mahoneypat
        Microsoft Employee

        You can use an Area Chart visual, and on the Data Colors part of formatting you can change the color under the top two lines to the same color and the color under the lowest line to white.

         

        Regards,

        Pat