Forum Discussion

RicLup's avatar
RicLup
Icon for Helper III rankHelper III
6 years ago
Solved

Combine 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 ...
  • v-alq-msft's avatar
    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.