Forum Discussion

Zakaria_1980's avatar
Zakaria_1980
Icon for Post Patron rankPost Patron
6 years ago

Line stype in the graph

Hello,

 

please I need that the curve in green whenevr it is before the bar chart the type of the line is solid and when it is after the bar chart the type of the line should be a dotted line. because all what is before the bar chart is our actuals and after the bar chart is our forecast.

the bar char is our reporting week (in below case is 20W33).

Thanks for your support.

 

13 Replies

    • Zakaria_1980's avatar
      Zakaria_1980
      Icon for Post Patron rankPost Patron

      the red bar is shifted automatically from week to another based on the actual figures that i got. in the grapg i've shared with you, i got the actuals for W33 which means the red bar is plot automatically in the that week.

       

      what i've asked is only on thu curve in green. in the graph i've sent i made the type of the line in dash. the team want that curve the type of the line should be solid before the red bar and then the type will change in dotted line after the red bar.

       

       

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

        HI Zakaria_1980 ,

         

        I don't think this is possible to achieve as you want same metric to be shown as solid line before the bar and dotted line after the same bar.

        Happy to know if someone in the community can tell a workaround for this.

         

        Thanks,

        Pragati

  • AllisonKennedy's avatar
    AllisonKennedy
    Icon for Community Champion rankCommunity Champion
    You can change the color of the line using conditional formatting and a measure to determine the date of the red line compared to the green curve, but you cannot make it solid/dotted without creating two distinct measures for this, which is another option.
    https://docs.microsoft.com/en-us/power-bi/visuals/service-tips-and-tricks-for-color-formatting

    Please provide sample data tables and your current calculations for the red and green lines if you would like more specific help.
  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi  Zakaria_1980 

    You could split the green line measure into two measure, then set line type separately.

    for example:

    Green measure 1=IF(MAX('Date'[Date])<=MAX('20W33'[Date]),[green line measure])

    Green measure 2=IF(MAX('Date'[Date])>=MAX('20W33'[Date]),[green line measure])

     

    Then use Green measure 1  and Green measure 2  in the line chart instead of green line measure. Now do formatting for these two new measure.

     

    Regards,

    Lin

    • Zakaria_1980's avatar
      Zakaria_1980
      Icon for Post Patron rankPost Patron

      for the green line i don't have a measure but a column which is calculating the cumulative of my data

       

      • v-lili6-msft's avatar
        v-lili6-msft
        Icon for Community Support rankCommunity Support

        hi Zakaria_1980 

        Could you please share your sample pbix file for us have a test, that will be a great help.

         

        Regards,

        Lin