Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I like to change the format of a column to date with the following values:
EndPricingPeriod
| May 2021 |
| 202108 |
| 202107 |
| 202107 |
| 202108 |
| May 2021 |
| May 2021 |
| May 2021 |
| July2021 |
| July 2021 |
| July2021 |
| July 2021 |
| July 2021 |
| July 2021 |
| July 2021 |
| July2021 |
| July 2021 |
| July 2021 |
| July 2021 |
| July2021 |
| July 2021 |
| July 2021 |
| July 2021 |
| July 2021 |
| July 2021 |
| July 2021 |
| 202108 |
| 202107 |
| 202107 |
| July 2021 |
As you can see there are two formats of the dates.
When I try to convert the values I get an error on the ones that look like '202107':
DataFormat.Error: We couldn't parse the input provided as a Date value.
I'd like to format these values to date type in Power Query as well.
Does anyone know how to do this?
Thanks!
Solved! Go to Solution.
@Anonymous
Add a custom column with the following code then change Data TYpe to Date
=try Date.From( [EndPricingPeriod] & "01" ) otherwise [EndPricingPeriod]
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
Add a custom column with the following code then change Data TYpe to Date
=try Date.From( [EndPricingPeriod] & "01" ) otherwise [EndPricingPeriod]
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Nice and easy solution! Thank you!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 7 |