Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

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":

vyueyunzhmsft_0-1672714048112.png

(2)Then we can enter in turn:

vyueyunzhmsft_1-1672714161187.png

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

(3)Then we can meet your need:

vyueyunzhmsft_2-1672714225037.png

 

 

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

vyueyunzhmsft_3-1672714286181.png

(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:

vyueyunzhmsft_4-1672714377096.png

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

View solution in original post

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

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":

vyueyunzhmsft_0-1672714048112.png

(2)Then we can enter in turn:

vyueyunzhmsft_1-1672714161187.png

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

(3)Then we can meet your need:

vyueyunzhmsft_2-1672714225037.png

 

 

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

vyueyunzhmsft_3-1672714286181.png

(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:

vyueyunzhmsft_4-1672714377096.png

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

NandanHegde
Super User
Super User

you can create derived column:

NandanHegde_0-1672648254059.png

And use DAX:

 

for Day use Day function

For year use YEAR function

For Month: use the above format function

 

using the Month function gives output in numbers

 

To get full month name , you can use Switch statements or 

NandanHegde_0-1672649352985.png

 




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
lin_k
New Member

Hi @Anonymous 

 

there are several ways possible to achive this. I'd advice to do the following:

1. Selcect Datatype as Date (then you'll see a small Date-Icon)

lin_k_0-1672647634383.png

2. Select the Column and then go to "Add Column", Here go to "From Date & Time" and there select the Options accordingly:

lin_k_1-1672647824147.png

This will add the Columns as you want. When your'e finished, you can delete the original Column.

 

Best Regards!

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.