Forum Discussion

jwint's avatar
jwint
Frequent Visitor
1 year ago
Solved

Help with a line chart

Hello,

 

I have created a line chart to summarize production data over a 5yr period.  It seems like, for some reason, power bi is summarizing the data.   If you look at the y axis on both sides of the graph below, you can see what I am talking about....

 

The range on the left hand side should be between 0 and 3000 but its like 0 to 60k.  And the range on the right (secondary y axis) should be like 0 to 4k.   can anyone help with this?  Thank you

  • Buddy, the moving average on what field should be calculated? On total power?

     

    Well I've looked at the pbix and:

    • Why do you expect the secondary Y-axis to have a range between 0 and 4k when your maximum tons delivered are over 6k?

       

    • Instead for the Y axis I suppose it's wrong your moving average formula. Try with this

      Moving Average Total Power (28 Day) =
      CALCULATE(
          AVERAGE('Elec Prod'[Total Power]),
          DATESINPERIOD(
              'date'[Date],
              MAX('date'[Date]),
              -28,
              DAY
          )
      )
    • Not sure why you set the relationship between datetable and Elecprod bidirectional. I think you should avoid bidirectional.

     

     

    Let me know if I helped you

12 Replies

  • _AAndrade's avatar
    _AAndrade
    Resident Rockstar

    Hi jwint,

    Can you provide more information or share an example so I can try to help you?

  • Gabry's avatar
    Gabry
    Super User

    Hello,

    the picture is too small, I can't see nothing.
    Can you load sample pbix?

      • Gabry's avatar
        Gabry
        Super User

        Buddy, the moving average on what field should be calculated? On total power?

         

        Well I've looked at the pbix and:

        • Why do you expect the secondary Y-axis to have a range between 0 and 4k when your maximum tons delivered are over 6k?

           

        • Instead for the Y axis I suppose it's wrong your moving average formula. Try with this

          Moving Average Total Power (28 Day) =
          CALCULATE(
              AVERAGE('Elec Prod'[Total Power]),
              DATESINPERIOD(
                  'date'[Date],
                  MAX('date'[Date]),
                  -28,
                  DAY
              )
          )
        • Not sure why you set the relationship between datetable and Elecprod bidirectional. I think you should avoid bidirectional.

         

         

        Let me know if I helped you

  • Check Y-Axis Settings:

    Select the visual and go to the Format pane (the paint roller icon).
    Expand the Y-Axis section.
    Ensure that the Minimum and Maximum values are set correctly. You can set them manually if automatic scaling isn’t providing the desired range.

    • Gabry's avatar
      Gabry
      Super User

      First, you need to drill down into the dates. If you're looking at an entire year, I assume it should be aggregated. So, if you need daily granularity, you will need to drill down.

      For the second axis, right-click and select 'Do not aggregate.' Currently, the values are being summed

      • jwint's avatar
        jwint
        Frequent Visitor

        Can you explain how to add this drill down?