The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello Community,
I am new to PowerBI and currently, I am trying to create a new table using DAX query to extract only one field (Date/Time) into the table. Then I want to create new columns for month and year (based on the date/time field).
Is there a simple solution to this ?
Thank you.
Regards,
Solved! Go to Solution.
@Omar_204 somthing like:
Table =
ADDCOLUMNS(
SELECTCOLUMNS(
SourceTable,
"Date", SourceTable[YourDateTime Column]
),
"Month", MONTH([Date]),
"Month Name", FORMAT([Date], "mmmm"),
"Year", Year([Date])
)
Thanks @SpartaBI .
This created a new table with exactly what I was looking for, except the month is showing as a number.
How can I make this the Month name ?
@Omar_204 I added it in the original repsonse now.
Please don't forget to mark that as a solution and appreciate your kudos 🙂
@Omar_204 somthing like:
Table =
ADDCOLUMNS(
SELECTCOLUMNS(
SourceTable,
"Date", SourceTable[YourDateTime Column]
),
"Month", MONTH([Date]),
"Month Name", FORMAT([Date], "mmmm"),
"Year", Year([Date])
)
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |