Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Dear all,
I face the issue that there's no valid date in my data model.
Data source is Python and I'm not allowed to make any changes there.
The column that contains data information has the following structure: YYYYMM (e.g. 202412). However, this is not a valid date PowerBI can work with (e.g. I would like to work with the moving average function). Is there any possibility to convert the given text format in a valid date format? In Excel I could help myself with Right / Left functions (e.g. ="01"&"."&RIGHT(D4;2)&"."&LEFT(D4;4) to get 01.12.2024). But I have no idea what to do in PowerBI.
Many thanks for your help. Kind regards, Mathias
Solved! Go to Solution.
@podma , Create a new calculated column using the below DAX
ValidDate =
VAR YearPart = LEFT('YourTable'[DateText], 4)
VAR MonthPart = RIGHT('YourTable'[DateText], 2)
RETURN
DATE(YearPart, MonthPart, 1)
Proud to be a Super User! |
|
Many thanks
@podma , Create a new calculated column using the below DAX
ValidDate =
VAR YearPart = LEFT('YourTable'[DateText], 4)
VAR MonthPart = RIGHT('YourTable'[DateText], 2)
RETURN
DATE(YearPart, MonthPart, 1)
Proud to be a Super User! |
|
your formula went perfectly well. As you can see in the following:
However, I got the following error message once I tried to realize a quick measure (a rolling average) based on the new column. Do you know why it's still not running?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.