Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have a data set where one ofthe columns is created_date(mm/dd/yyyy). I want to create another column where if the created_date is before 04/10 it populates "Historic" otherwise it populates the month and year from the created_date column.
Is it possible to do it?
Any help on this is much appreciated.
Solved! Go to Solution.
Hi @Anonymous ,
You are creating a column in Power Query while the above code is in DAX, this is the reson you are getting the error RightParen expected.
Incase you want to do it in M Language or Power Query
Column = if [Date] < #date(2020, 4, 20) then "Historic" else (Date.MonthName([Date]) & " " & Text.From(Date.Year([Date]))))
Replace [Date] --> with Created_Date
In DAX
Thanks for your response! However, this doesnt seem to work . It shows an error RightParen expected.
HI @Anonymous
Us teh below code
IF(table([CREATED_DATE])<DATE(2020,04,10),"Historic", FORMAT([CREATED_DATE],"MM/YYYY"))
Hi @Anonymous ,
You are creating a column in Power Query while the above code is in DAX, this is the reson you are getting the error RightParen expected.
Incase you want to do it in M Language or Power Query
Column = if [Date] < #date(2020, 4, 20) then "Historic" else (Date.MonthName([Date]) & " " & Text.From(Date.Year([Date]))))
Replace [Date] --> with Created_Date
In DAX
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |