Forum Discussion

Power-BI's avatar
Power-BI
New Member
10 years ago
Solved

Smooth lines

Is there any way to smooth lines on a line chart?

 

I'd like it to flow more like this one made in Excel, than the one below it made in PBI.

 

Many thanks

  • hi. there is not a way to do this in powerbi that i am aware of. 

     

    I know that the smoothed line looks good but is it an accurate representation of the data? 

14 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Kolumam  Is correct

       

      When you download the "Power KPI" viz from the market place, you are going to want to edit the line by selecting 'Monotone'.  see screenshot

       

       

       

      Best,

      Eric

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello Power-BI and samdthompson :

    You may be aware of this, but from the july 2023 release smooth lines are available.
    See release note :
    Release note july 2023

    or the snippet from the release note below:

     


    Kind regards!

    If this solved your problem, consider marking this answer as a solution.

  • samdthompson's avatar
    samdthompson
    Memorable Member

    hi. there is not a way to do this in powerbi that i am aware of. 

     

    I know that the smoothed line looks good but is it an accurate representation of the data? 

    • dobermanne's avatar
      dobermanne
      Advocate I

      "..is it an accurate representation of the data?" - it can well be more accurate than showing only the measured points..

       

      In case the data in question is anyway an estimate and contains error, representing absolute points instead of smooth lines indicating that "it is roughly like X" is totally and utterly warranted in my opinion. Also, for cases where you have continous phenomenon underneath (such as temperature...) but have only discontinuous measurements (say hourly), again, smoothing the lines to be continuous more truly represents the underlying distribution, of which the collected data is only a partly representing sample. I disagree with your stance for many a dataset of reality.

    • mussol_'s avatar
      mussol_
      Advocate II

      If you want to represent a "Gauss Bell", it is completely necessary to have smooth lines to understand the distribution.

      That's because i think it is necessary to have the possibility to represent a smooth line chart.

      Josep.

    • unclejemima's avatar
      unclejemima
      Post Patron

      This was a while back...any chance this is possible in new version?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Seems like a terrible idea anyway. In that example picture the curves make the lines go higher and lower than the actual data points they're connecting. So the graph is lying. It looks pretty but it's worse than useless for representing data. It's a good thing that we don't have this "feature".

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello,! The Power KPI worked in making the lines smooth or monotone.. The probem i encountered is when i publish it to wapp.powerbi workspace.. it is creating an error. the powerBi is already added in the power bi desktop but i dont see how i can add this to  app.powerbi

     

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Power-BI,
    Here visual shows smooth lines instead of lines which will help you get different line styles. smooth lines. PBIVizEdit.com 

     

    Download link for the custom visual file on this page,

    https://pbivizedit.com/gallery/smooth-lines-in-line-chart 

     

    This was made with our Custom Visual creator tool PBIVizEdit.com. With this tool,

    • anyone, irrespective of technical skills, can create their own visuals
    • 15 minutes to create a visual from scratch
    • opens up many additional attributes to edit (for e.g. labels, tooltips, legends position, etc)

    Give this a shot and let us know if you face any problems/errors.
    You can use the editor to modify your visual further (some modifications cannot be done in the Power BI window and have to be in the editor).

    Thanks,
    Team PBIVizEdit

  • So I managed to get a decent result for a smoothed linechart on a monthly basis: 

     

    LogisticSmoothing =
    VAR GrowthRate = 0.5
    VAR CurrentRowDate = MAX(SHARED_Date[Date])
    VAR CurrentRowDatePM = PREVIOUSMONTH(SHARED_Date[Date])
    VAR EndMonth = ENDOFMONTH(SHARED_Date[Date])
    VAR Midpoint = DATE(YEAR(CurrentRowDate), MONTH(CurrentRowDate), 15)
    VAR Sales = CALCULATE([Total_sales], ALL(SHARED_Date), MONTH(CurrentRowDate) = MONTH(SHARED_Date[Date]), YEAR(CurrentRowDate) = YEAR(SHARED_Date[Date]))
    VAR SalesPM = CALCULATE([Total_sales], ALL(SHARED_Date), CurrentRowDatePM)
    VAR SalesDiff = sales - SalesPM
    VAR LogisticSmoothedValue =
        CALCULATE (
            DIVIDE (
                1,
                1 + EXP ( - GrowthRate * ( DATEDIFF(Midpoint, CurrentRowDate, DAY) ) )
            )
        ) * SalesDiff
    RETURN
        LogisticSmoothedValue + SalesPM
     

     

     

    This Formula calculates the Sales on a monthly basis but between each start and end of the month it calculates the change in a logistical curve so it smooths out the numbers betweeen each monts close. Be aware that this only works if you have "dates" on your x-axis. It may not represent your accurate data between months bit it looks just nice.