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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
irnm8dn
Post Prodigy
Post Prodigy

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

@Smauro

 

This looks like heavy lifting for a newbie.

 

Any other suggestions for a simple DAX statement?

@irnm8dn, 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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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