Forum Discussion
Date format
- Anonymous5 years ago
Hi Anonymous,
Sure, your values aren't the regular date types, it seems like you stored the start and end years into one field, right?
If this is a case, I'd like to suggest you add two calculated columns to extract the start part and end part from your raw field then you can set conditions based on new fields.
Calculate columns:
Start = DATE ( VALUE ( LEFT ( [Year], 4 ) ), 12, 31 ) End = DATE ( VALUE ( LEFT ( [Start], 2 ) & RIGHT ( [Year], 2 ) ), 12, 31 )Notice: the right part 12 and 31 is the default value I used to complete the date function because your raw value did not exist the month and day levels.
Regards,
Xiaoxin Sheng
- 5 years ago
Anonymous It has a date or datetime data type depending on whether you are using Power Query or DAX, but not sure what youo mean by date format for date ranges - usually when you want to work with elapsed time or durations you have a separate start and end date/time.
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
I need to convert my date "2020-21" currently formated as text to date for year-to-year calculation purpose. Your suggestion, Anonymous , did not work.
Hi Anonymous,
Sure, your values aren't the regular date types, it seems like you stored the start and end years into one field, right?
If this is a case, I'd like to suggest you add two calculated columns to extract the start part and end part from your raw field then you can set conditions based on new fields.
Calculate columns:
Start =
DATE ( VALUE ( LEFT ( [Year], 4 ) ), 12, 31 )
End =
DATE ( VALUE ( LEFT ( [Start], 2 ) & RIGHT ( [Year], 2 ) ), 12, 31 )
Notice: the right part 12 and 31 is the default value I used to complete the date function because your raw value did not exist the month and day levels.
Regards,
Xiaoxin Sheng
- Anonymous5 years agoNot applicable
Thank you, Anonymous . Does it mean that Power BI has no date format for date ranges that include multiple months?