Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Redshift direct query incorrecty returning negative delta

Hi 

I'm experiencing problems connecting to redshift and using datediff.  It's returning a negative value for two dates but only on some rows

I've checked that both the database date fields are defined as date/time

I've also checked in redshift itself and if i use datediff there it works correctly

I've also spun up the same table in tableau and it works fine there so it really seems like some sort of issue with powerbi

 

any pointers/help would be much appreciated!

thanks!

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 
    Do you use import or direct query mode to connect redshift? Are you creating a measure or column ,and Can you share the formula?


    Paul Zheng _ Community Support Team

    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous 

      Hi Paul

      sorry i missed this response - thanks for engaging!

      Our customer is using direct query mode to connect to redshift 

      a column is being created by our customer using the following formula

      Column = DATEDIFF('cases'[date_started],'cases'[date_completed],day)

       

      Could it be some sort of configuration on their end?  When my dev team imports his report template and runs it on the database we can see all the dates are correctly calculating

       

      They are using Version 2.82.5858.1161 64-bit (June 2020)

      Thanks!