Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hi All,
I'm tring to extract month from date column in the table shown below. But I'm getting wrong month. For the month of July, Jan is returned in the month column. Please what could be the issue? I have checked my formula over and over again, but don't see anything wrong.
Solved! Go to Solution.
Hi again @Junkay
The ENDOFMONTH function will produce the expected result as long as the column reference provided as an argument is for a column which contains complete calendar months. If any dates are missing, this function treats the last available date in a given calendar month as the last day of the month. The tutorial you were using may have already had a table containing complete months.
For this reason, I would generally not advise using ENDOFMONTH to return a scalar end-of-month value. EOMONTH is the best function for this.
ENDOFMONTH is typically used within CALCULATE to modify a date filter by shifting it to the last day of the last visible month. ENDOFMONTH returns a 1x1 table which retains lineage to the column reference passed as its argument.
On to your latest question, to return an end-of-quarter date, I would advise using EOMONTH again.
For standard calendar quarters (Jan-Mar, Apr-Jun etc), an expression like this should work:
EOMONTH ( [Date], MOD ( - MONTH ( [Date] ), 3 ) )
Hi Owen,
You are a genius. Thank you so much for the support.
I wish I could be this proficient.
Thanks a million times.
Thanks greatly Owen,
EOMONTH function worked. But I wonder why ENDOFMONTH get accurate result in the tutorial I was using, but not working for me. Also, I have same challenge with ENDOF QUARTER function. It’s not returning the last day of the quarter. I’m not sure there’s EOQUARTER function in Power BI.
Formula:
Result:
Thanks Owen.
Hi again @Junkay
The ENDOFMONTH function will produce the expected result as long as the column reference provided as an argument is for a column which contains complete calendar months. If any dates are missing, this function treats the last available date in a given calendar month as the last day of the month. The tutorial you were using may have already had a table containing complete months.
For this reason, I would generally not advise using ENDOFMONTH to return a scalar end-of-month value. EOMONTH is the best function for this.
ENDOFMONTH is typically used within CALCULATE to modify a date filter by shifting it to the last day of the last visible month. ENDOFMONTH returns a 1x1 table which retains lineage to the column reference passed as its argument.
On to your latest question, to return an end-of-quarter date, I would advise using EOMONTH again.
For standard calendar quarters (Jan-Mar, Apr-Jun etc), an expression like this should work:
EOMONTH ( [Date], MOD ( - MONTH ( [Date] ), 3 ) )
Hi Owen,
You are a genius. Thank you so much for the support.
I wish I could be this proficient.
Thanks a million times.
Thank you so much, Owen. This resolved it.
But I have another challenge. My End of Month function is also returning wrong result:
Formular below:
Result below:
Thanks for your support.
@Junkay Glad to hear it 🙂
If you want to return the end-of-month date as a scalar value, you should use the EOMONTH function (which works the same as in Excel).
In your example:
EOMONTH ( Orders[Order Date], 0 )
ENDOFMONTH is a time intelligence function, normally used to modify date filters. It will return a single-column/single-row table containing the last date of a month from the set of dates that exist in the column referenced.
Regards
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
72 | |
62 | |
51 | |
48 |
User | Count |
---|---|
206 | |
90 | |
62 | |
59 | |
57 |