Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
New to Bi. Just playing about. Thought I was doing the simplest thing in the world but apparently it's not.
I have just 1 table for simplicity. In my data there is a timestamp field. I wanted to create month and year columns based on this timestamp. How hard could it be?
I go to create a customer variable.
In the new column name box I put "year" because that seems a sensible name.
In the customn column formula I put = year([time])
BI then tells me there is no syntax errors have been detected. great stuff. should be no issues then. Oh wait. I click ok and it tells me that "Expression.Error: The name 'year' wasn't recognized. Make sure it's spelled correctly."
Apparently just finding information related to doing this type of query is impossible too so if anyone can just tell me how I can do this that'd be great.
Solved! Go to Solution.
Hi,
You can do this in the Query editor itself, just take a duplicate of the datetime column you have, then right click and go to below.
The custom column you add in Query Editor is based on Power Query syntax instead of DAX. So you should use "Date.Year()" function.
Regards,
Hi,
You can do this in the Query editor itself, just take a duplicate of the datetime column you have, then right click and go to below.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
95 | |
82 | |
71 | |
64 |
User | Count |
---|---|
116 | |
106 | |
94 | |
79 | |
72 |