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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bullius
Helper V
Helper V

MAX day of month TRUE or FALSE

Hello,

I would like to add a column to a table. The table includes a date column. I would like the new column to show TRUE if the date is the MAX in any given month. E.g.

DateNew Column
03/04/2016FALSE
19/04/2016TRUE
12/04/2016FALSE
06/05/2015FALSE
11/05/2016FALSE
15/05/2016TRUE


Any suggestions as to what formula might produce this?

Thanks!

1 ACCEPTED SOLUTION

Oh, just the latest date whether it's the true end of the month or not?

 

MaxOfMonth = IF(
	Table1[date] = CALCULATE(
		MAX(TableName[date]),
		FILTER(
			ALL(TableName),
			MONTH(TableName[date]) = MONTH(EARLIER(TableName[date])) &&
			YEAR(TableName[date]) = YEAR(EARLIER(TableName[date]))
		)
	),
	TRUE,
	FALSE
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
KHorseman
Community Champion
Community Champion

EndOfMonth = IF(TableName[date] = EOMONTH(TableName[date], 0), TRUE, FALSE)

 

EOMONTH function





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks @KHorseman,

 

It's not the EOM that I want, it is the MAX date in month; this might be, for example, 22 September, as data is not included for every date in the month.

Oh, just the latest date whether it's the true end of the month or not?

 

MaxOfMonth = IF(
	Table1[date] = CALCULATE(
		MAX(TableName[date]),
		FILTER(
			ALL(TableName),
			MONTH(TableName[date]) = MONTH(EARLIER(TableName[date])) &&
			YEAR(TableName[date]) = YEAR(EARLIER(TableName[date]))
		)
	),
	TRUE,
	FALSE
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thanks @KHorseman,

 

That's the one!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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