Forum Discussion

Kolumam's avatar
Kolumam
Post Prodigy
8 years ago

Calculating the difference in energy readings using difference in dates

Hi All,

 

I have 3 columns. I wanna find the difference between the last and the first readings of "total_energy_generated_till" based on the timestamp of a day and based on the inverter ID. How do I acheive this ?

7 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    Hi Kolumam

     

    This calculated table gets pretty close.  Just change where I have 'Table'

     

    New Table = SUMMARIZE(
                    ADDCOLUMNS(
                        'Table',
                        "Date",DATEVALUE(FORMAT('Table'[Tstamp],"YYYY-MM-DD"))
                        ),
                    [Date],
                    [InverterID],
                    "myMin",MIN('Table'[total_energy_generated_til]),
                    "myMax",MAX('Table'[total_energy_generated_til]),
                    "Diff",MAX('Table'[total_energy_generated_til]) - MIN('Table'[total_energy_generated_til])
                    )

     

    • Kolumam's avatar
      Kolumam
      Post Prodigy

      Hi Phil_Seamark

       

      I am using DirectQuery and I am not able to create a new table. Any suggestions please ?

      • Phil_Seamark's avatar
        Phil_Seamark
        Microsoft Employee

        What is your direct query datasource?  Is it an SQL datasource?