Date Conversion in Power BI - powerbi

I have Date in format as Date
1/24/2019 2:10:14 AM
Power BI read it as text. I want to convert it as
1-24-2019 2:10:14 AM
in single cell Date format.
I tried split, works but it change the format to
24/1/2019 2:10:14
& I also need AM which I was unable to concatenate.

Can you please try
FORMAT(datecolumn , "MM-DD-YYYY hh:mm:ss am/pm")

Related

Power BI Error - Cannot convert text into date type

I have a table in Power BI with blanks and also Text in the following format "01/11/2021 00:00:00"
When I highlight this date column and attempt to convert to data type to date I get an error.
"we cannot automatically convert the column to date type".
I'm not sure what's causing it to error. I have other columns that are formatted the same and they converted no problem.
Thanks

Can Power BI insert a row which has special format?

I am new for Power Query, I want to insert a row, but this row has different data format. I used :
Table.InsertRows(_, Table.RowCount(_),{[DATE="01/01/1990", MAINACCOUNT= 00001, AMOUNT=0, Financial Year=""]})
But the DATE, I want it to be date format, the AMOUNT I want it to be number format, anyone know how to do it?

Change string "dd/mm/yy HH:mm:ss" into accepted date/time format

I have a very rare date format dd/mm/yy HH:mm:ss that reads in as a string and I want to transform it into a date/time format PowerBI will accept. I managed to change the format into "dd/mm/yyyy HH:mm:ss", but now I have to switch the day part with the month.
How can I do this or is there an easier solution to my problem?
Select the column of date_time and change the data type from column tools to Date/time(pic 1) and after that select the format(pic 2) from column tools
pic_1
pic_2

Power BI text to date in "mmm-yy" format

I have an excel file having a column with Text format values like Jan-18, Dec-19, Feb-20. I want to convert it to a date format but when I am trying to make this column a date format it printing 1/18/2021, 12/19/2021,2/20/2021. Basically its considering Jan as month(1), 18 as Date, & making all year as 2021 deafult.
Can someone help?
Original(text) After Date conversion Desired format
Jan-18 1/18/2021 01/01/2018
Feb-19 2/19/2021 01/02/2019
Mar-20 3/20/2021 01/03/2020
You can try,
DATE(2018, MONTH(convertedDate), 1)
This will convert your converted date to the first day of the relevant month in 2018. This is stored in Power BI as a datetime object. If you want to show that value in dd/MM/yyyy format you can do it by selecting correct Format in the top menu.
If you load in the Original column as text, try this trick:
Desired format = DATEVALUE ( "1-" & [Original] )
Appending the "1-" to the beginning gives it a day of the month and forces it to recognize the last digits as the year.
I faced with the same issue , while changing the format instead of using Date use the last option i.e "Using Locale... " -> in that change the Data Type from Text -> Date, and Locale to English(United Kingdom) -> Hit ok. Earlier Format ,What should be the desired format .This worked for me!

Excel unable to subtract dates in "dd/mm/yyyy hh:mm" format

I have 2 adjacent columns in excel, each having dates in "dd/mm/yyyy hh:mm" format. But when I try to subtract them in the third column, it is unable to give me a numerical value, instead it shows the text "#value!" in the cell. How do I get the time difference between the 2 dates -
Answered behalf of Scott Craner
Then the "Dates" are text and not true Dates. You will need to convert them to true dates. My guess is that your local settings are mm/dd/yyyy not dd/mm/yyyy and as such Excel does not see them as dates
Check below link to know more.
https://www.ablebits.com/office-addins-blog/2015/03/26/excel-convert-text-date/