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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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