Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
judddonnelly
Regular Visitor

Custom column Date.from dataset values

I have 3 columns in my dataset that represent Year, Month and Day.  They are call Y, M, D respectice and are all text values.  Trying to create a custome column that return a date from these.  Tried Date.From(#date([Y],[M],[D])) but getting an error.

6 REPLIES 6
CNENFRNL
Community Champion
Community Champion

= Table.AddColumn(Source, "date", each Date.From(Text.Combine(Record.ToList(_), "/")))

Screenshot 2021-07-29 024537.png

 

= Table.AddColumn(Source, "Date", each #date(Number.From([Y]),Number.From([M]),Number.From([D])))

Screenshot 2021-07-29 024657.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @judddonnelly 
Create this Calculated column:
Date= DATE(YEAR(Y), MONTH(M), DAY(D))

 

Mark it as a solution if it answers your question.

Thanks!

 

judddonnelly_2-1627483805956.png

 

judddonnelly_0-1627483629693.png

 

judddonnelly_1-1627483784303.png

 

@judddonnelly ,

Not in the power query.

Create a calculated column...in your table in the data view.

Write the DAX for the column.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors