Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a text field that contains year and month only (ex '201801'). How do i create a date field using this text field.
Thanks!
Sallee
Solved! Go to Solution.
Well, in DAX you could do this:
Column = DATE(INT(LEFT([Column1],4)),INT(RIGHT([Column1],2)),1)
Well, in DAX you could do this:
Column = DATE(INT(LEFT([Column1],4)),INT(RIGHT([Column1],2)),1)
Sallee,
create a new column in same table with following code where varible _Date can be equal to other column in a table with dates.
3rd argument of the DATE function defines a day. In my case the result will be 1/1/2018
= VAR _Date = "201801" RETURN DATE(left(_Date,4),MID(_Date,5,2),1)
Hi, I have this formula
Businessdate = DATE(LEFT([BUS_YEAR_MTH],4),MID([BUS_YEAR_MTH],5,2),1)
but it is giving me this error:
Expression.Error: The name 'DATE' wasn't recognized. Make sure it's spelled correctly.
Thanks for your help!
Sallee
Hi @Anonymous
Open Power BI Desktop,click on "New column" from the home menu, "DATE" function should be possible.
Reference:
Best Regards
Maggie
works fine for me. try to use this sample as per link below.
https://1drv.ms/x/s!AhUWZ84uo7UAgmM8kvkwm1THdmsj
Alternative solution, Greg offered, should also work fine, use either one.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
75 | |
60 | |
37 | |
33 |
User | Count |
---|---|
102 | |
56 | |
52 | |
46 | |
40 |