Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Dear all,
I've a column in this format: 20210312 (YYYYMMDD).
I want to create a new colum date.
How can I do it?
Because with date(column) it doesn´t works.
Solved! Go to Solution.
Hi @godtooro ,
You could try below code:-
new_date =
VAR _year =
MID ( 'Table'[Column1], 1, 4 )
VAR _month =
MID ( 'Table'[Column1], 5, 2 )
VAR _day =
MID ( 'Table'[Column1], 7, 2 )
RETURN
DATEVALUE ( _year & "-" & _month & "-" & _day )
Output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @godtooro ,
You could try below code:-
new_date =
VAR _year =
MID ( 'Table'[Column1], 1, 4 )
VAR _month =
MID ( 'Table'[Column1], 5, 2 )
VAR _day =
MID ( 'Table'[Column1], 7, 2 )
RETURN
DATEVALUE ( _year & "-" & _month & "-" & _day )
Output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi!!
Superb!! Works great! Thank you, thank you so much.
Hi @godtooro,
You can use the "FORMAT" function to convert the date in the YYYYMMDD format to a date format that can be used for analysis. Here's an example formula:
Date = DATEVALUE(FORMAT(Table1[Column], "####/##/##"))
In this formula, "Table1" refers to the name of your table and "Column" refers to the name of the column containing the YYYYMMDD date format. The "FORMAT" function converts the date to the format "####/##/##", which is the format recognized by the "DATEVALUE" function.
Best regards,
Isaac Chavarria
If this post helps, then please consider Accepting it as the solution and giving Kudos to help the other members find it more quickly
Thank you so much!
I've this error: number entry "20210329" is out of the interval YYYY/MM/DD.
Do you know why it is?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
42 |