Forum Discussion

NigelP99's avatar
NigelP99
Regular Visitor
3 years ago
Solved

Creating A Simple graph using two columns of a Dataverse Table

Hi 

I have a very simple dataverse table consisting of a Date Time field "Created On" and a Numeric field called "Temperature".

 

I want PowerBI to have the "Created on" on the X-Axis and the "Temperature" on the Y-Axis.

 

PowerBI insists I want the "Sum Of" temperatures on the Y-Axis. I do not.

 

This should be just  case of dragging "Created on" onto the X-asxis and "Temperature" onto the Y axis and perhaps Filter on the last 24 hrs.

 

Why is this so difficult ?

 

Or is this a bug in PowerBI ?

 

Regards

 

Nigel

  • bolfri's avatar
    bolfri
    3 years ago

    Yes, you're missing the fact that in visual you need to give Power BI context of aggregation. In your case even if you will put the AVG/SUM to the field - it will return the value of the field.

    SUM(17,2) is 17,2
    AVERAGE(17,2) is still 17,2

    Doesn't matter if you will use SUM or AVG - it will return its value.

10 Replies

  • bolfri's avatar
    bolfri
    Icon for Solution Sage rankSolution Sage

    Due to fact that you've not provided any sample data I've used my own.

     

    Created onTemperature (Celsius)
    2022-01-01 12:00:0022,5
    2022-01-02 12:00:0021,3
    2022-01-03 12:00:0019,8
    2022-01-04 12:00:0017,4
    2022-01-05 12:00:0014,2
    2022-01-06 12:00:0011,1
    2022-01-07 12:00:008,4
    2022-01-08 12:00:005,9
    2022-01-09 12:00:004,2
    2022-01-10 12:00:002,8
    2022-01-11 12:00:00-0,5
    2022-01-12 12:00:00-2,8
    2022-01-13 12:00:00-4,4
    2022-01-14 12:00:00-6,7
    2022-01-15 12:00:00-9,4
    2022-01-16 12:00:00-11,7
    2022-01-17 12:00:00-14,4
    2022-01-18 12:00:00-16,7
    2022-01-19 12:00:00-19,4
    2022-01-20 12:00:00-22,2

     

    Step 1) Make sure that Created on is a date/datetime format and Temperature is numeric one.

    Step 2) Choose Clustered column chart and drag Created on to X-axis and Temperature on Y-axis.

     

     

    Note that my data is based on random values, so it looks silly, but it works OK 🙂

    • NigelP99's avatar
      NigelP99
      Regular Visitor

      Thanks for your prompt response.  Here was what I was hoping to get (works from Excel!) 

       

      This is what happens if I use a line chart in PowerBI

       

       

      I dont understand why this works in Excel but not in PowerBI.

       

      Regards

       

      Nigel

      • bolfri's avatar
        bolfri
        Icon for Solution Sage rankSolution Sage

        Remove Created on from legend.

        Make sure to use dates on Y-axis, not only Time value.