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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Akbarov
Helper I
Helper I

Power Query EndOfMonth

Hello community,

 

I have data where dates stored as number. 

202006 <--as 2020/06

 

So I created new column in PQ to transfor it to real date.

= Table.AddColumn(#"Added Custom", "MonthFrom", each Date.FromText(Number.ToText([Month From]) & "01"))

 

I added "01" to the end of numbers. But I want to know , how can I add EndOfMonth instead of "01"?

 

Thank you.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You could use the Date.EndOfMonth() function with what you already have.

 

= Table.AddColumn(#"Added Custom", "MonthFrom", Date.EndOfMonth(Date.FromText(Number.ToText([Month From]) & "01")))

 

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

You could use the Date.EndOfMonth() function with what you already have.

 

= Table.AddColumn(#"Added Custom", "MonthFrom", Date.EndOfMonth(Date.FromText(Number.ToText([Month From]) & "01")))

 

HotChilli
Community Champion
Community Champion

There is a Date.EndOfMonth function (it's available from the interface too -> Add Column->Date->Month) and it needs a legitimate date to work on so this would be additional to the step that adds "01" to make a valid date.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.