Forum Discussion

QuantumLP's avatar
QuantumLP
Frequent Visitor
4 years ago

Line chart showing higher values below lower values

I have a line chart which shows current year vs same period last year, but for some reason, when the value is higher than the current year, the line shows much below the actual value on the chart which is misleading.

 

Below is an example for the month of August, last year the value is higher, howver the line shows below the current year

 

any idea how to fix this?

 

 

4 Replies

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi QuantumLP ,

     

    Are you able to provide the formula that was created. In my contemporaneous comparisons, it seems to show up fine, here are the formulas I created.

    this_year = sum(FactInternetSales[SalesAmount])
    Previous_year =
    CALCULATE ( [this_year], SAMEPERIODLASTYEAR ( M_DimDate[Date] ) )

     


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


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

    • QuantumLP's avatar
      QuantumLP
      Frequent Visitor

      My formulas are

       

      Sales previous period = CALCULATE([TOTAL Completed Sales],SAMEPERIODLASTYEAR(DimDate[Date]))
      TOTAL Completed Sales = SUM(ITAD_SP_Remarketing_Sales_Report[Completed_Sales])

       

      Both formatted as currency, however as you can see in the screenshot below, the values do not show correctly in the line graph. 

       

      I do have a filter on that visual to be this fiscal year

       

       

       

       

  • The problem happens because for each line and different measurement, the maximum of the Y axis is different.
    The solution I found was to create a measurement for the Y axis, in this measurement I look at which maximum value is the greatest between the two line measurements and choose it as a result to have the same value for both lines.

     

    #Y_axis_MaxValue_Productivity_Evolution_Current_Year_Chart = 
    var maxActual = CALCULATE(MAXX(f_kvi_summary_produtividade,[#produtividade/hr]))
    var maxGoal = CALCULATE(MAXX(f_kvi_summary_produtividade,[#meta/hr]))
    var calcMax = IF(maxActual > maxGoal, maxActual, maxGoal)
    
    return calcMax

     



     

     




  • sdomingues's avatar
    sdomingues
    Frequent Visitor

    Were you able to solve this? Happening the same thing here