Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Changing date

Hello Everyone,    I want to know about how can I change one column with "2022-8-30" to three separate columns Date = 30 Month = August Year=2022   BR
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi , Anonymous 

    According to your description, you want to add three column by the [Date].

    We can realize it both in Power Query Editor and in Power BI Desktop.

     

    [1]Power Query Editor:

    (1)We can click "Custom Column" in "Add Column":

    (2)Then we can enter in turn:

    Date.Year([Date])
    Date.Month([Date])
    Date.Day([Date])

    (3)Then we can meet your need:

     

     

    [2]Power BI Desktop:
    (1)We can click "New Column":

    (2)Then we enter in turn to create three calculated columns like this:

    Year = YEAR('Table'[Date])
    Month = MONTH('Table'[Date])
    Day = DAY('Table'[Date])

    (3)Then we can also meet your need:

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly