Forum Discussion
RicLup
Helper III
6 years agoCombine Date formats in the same Column
Hi all Hoping you can help me, if is possible combine date format in a column? I need to have a column like this in the expected date field: As you can see i need to convert the actual ...
- 6 years ago
Hi, RicLup
In Power BI Desktop, a column can only have a data type. If you want to have a column with two format("yyyy", "mm/dd/yyyy"). I'd like to suggest you try the following calculated column to get the result with text data type. I created data to reproduce your scenario.
Table:
Calculated column:
Formatted Date = IF( MONTH([Actual Date])=1&&DAY([Actual Date])=1, FORMAT([Actual Date],"yyyy"), FORMAT([Actual Date],"mm/dd/yyyy") )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
6 years agoRicLup - Right, I guess what I was saying or trying to say was to in your Power Query don't convert it to a date and instead convert it to text (I'm not sure how it is represented in your source data) or create a new column like:
Expected Date = IF(DAY([Actual Date])=1&&MONTH([Actual Date])=1,YEAR([Actual Date])&"",[Actual Date]&"")RicLup
Helper III
6 years agoTahnks a lot Greg_Deckler , works great!