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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Month Day Year Separate Columns - Concatenate to Complete Date - HELP! - DAX?

My data source is creating three separate columns, for Year, Month, Day, each recognized as a whole number.

 

I am looking for a simple statement that allows me to concatenate these elements and format as a date.

 

Appreciate all of the help from the PBI community.

 

Thanks!

1 ACCEPTED SOLUTION

the simple statement could be DATE function:

 

date.JPG

 

 

View solution in original post

7 REPLIES 7
Smauro
Solution Sage
Solution Sage

One solution could be combining them together in Power Query and then transforming the column to type date.

If you go to advanced editor in query editor and add these lines:

    CombinedYMD = Table.CombineColumns(Table.TransformColumnTypes(#"Previous Step", {{"month", type text}, {"day", type text}, {"year", type text}}, "en-US"),{"month", "day", "year"},Combiner.CombineTextByDelimiter("/", QuoteStyle.None),"Date"),
    CombinedYMDtoDate = Table.TransformColumnTypes(CombinedYMD, {{"Date", type date}})
in
    CombinedYMDtoDate

Replacing "#"Previous Step"" with the previous step's name in your query and month/day/year by your column names, it should work.




Feel free to connect with me:
LinkedIn

Anonymous
Not applicable

@Smauro

 

This looks like heavy lifting for a newbie.

 

Any other suggestions for a simple DAX statement?

@Anonymous, see @pawel1's solution. It's a lot easier and better than mine. Kudos to him. 🙂




Feel free to connect with me:
LinkedIn

the simple statement could be DATE function:

 

date.JPG

 

 

What if the month columns are month names, not number?? (January, February, March...)

I cannot get it to recognize DateFormat.  Any suggestions?

Hi,

 

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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