Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
My table has a column of type text. It stores the name of the month abbreviated and current year hyphenated.
Under column tables tab, once I click the field, can I change the Data Type to Date? Or will this cause internal problems?
Solved! Go to Solution.
@moe_elbohsaly
It depends on how that column has been used in your model in various calculations. As per your description, it is a text field, the best practice is to creat a dates table and link it to your fact table. you create a dates table with the following"
Dates = ADDCOLUMNS(
CALENDAR("01/01/2021","31/12/2021"),
"Month No" , MONTH([Date]),
"Month Name" , FORMAT( [Date] , "Mmmm" ),
"Year" , YEAR([Date]),
"Month Year No" , (YEAR([Date]) * 100) + MONTH ([Date]),
"Month Year" , FORMAT( [Date] , "Mmm yyyy"),
"Quarter" , QUARTER([Date]),
"Year Qtr" , FORMAT( [Date] , "YYYY \QQ"),
"Week Day" , WEEKDAY([Date],2),
"Week" , FORMAT( [Date] , "Dddd" )
)
.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@moe_elbohsaly
It depends on how that column has been used in your model in various calculations. As per your description, it is a text field, the best practice is to creat a dates table and link it to your fact table. you create a dates table with the following"
Dates = ADDCOLUMNS(
CALENDAR("01/01/2021","31/12/2021"),
"Month No" , MONTH([Date]),
"Month Name" , FORMAT( [Date] , "Mmmm" ),
"Year" , YEAR([Date]),
"Month Year No" , (YEAR([Date]) * 100) + MONTH ([Date]),
"Month Year" , FORMAT( [Date] , "Mmm yyyy"),
"Quarter" , QUARTER([Date]),
"Year Qtr" , FORMAT( [Date] , "YYYY \QQ"),
"Week Day" , WEEKDAY([Date],2),
"Week" , FORMAT( [Date] , "Dddd" )
)
.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks @Fowmy ! I managed to do a DAX namely FORMAT([text_column],"MMM-YYYY") since my text contains the month name abbreviated and current year hyphenated.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
106 | |
75 | |
44 | |
39 | |
33 |
User | Count |
---|---|
165 | |
90 | |
65 | |
46 | |
43 |