Need help for date type conversion in python script to manipulate data?

Hi All,
I need help in python script -

  1. Date Start , Date End convert to Text instead of Date - please help.
    Though the Date Start and Date End is formating correctly in python code

But when using the same code in power bi - giving me issue

I am adding the python script which I use to import data , please find the path : python/ at main · suvechha/python · GitHub

I also use Power BI with Postgresql and MS SQL and I work with dates. I have questions.

  1. Why are you using Python when PBI can do all of what you do, like data conversion? (I realize you may know Python better than PBI, and Python gives us more flexibility. So that’s a good reason to use Python.)
  2. Are you only data sources the Excel spreadsheet I see in your code?
  3. Are your date columns linked from another spreadsheet or do they physically exist in the spreadsheet? To simplify things make sure the dates physically exist in your Excel spreadsheet, and are not linked to there. PBI has limitations and a few bugs. “Keep It Simple”.

Hi @c-rob ,

Thanks for your reply.
I am trying to build a logic where Timesheet Date in DSR table needs to compare with Date Start and Date End.

Thus trying to use Python for data manipulation.

I have a PBI question in the below link

and also in Python

Will you able to have a look and help please

Just off the top of my head. If you have 2 tables, call them table1 and table2, in PBI that don’t have linking fields (like some type of ID field) you can link them with a date table in PBI. But this requires both tables, table1 and table2, each have a date field that links to the date field in your date table.

Have you read up and tried a date table? Here’s a search for you.

We do this for time sheets as well because the part of our system that does time sheets was hacked together (by the vendor) and wasn’t designed very well.