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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
shelbsassy
Resolver I
Resolver I

How to get the max service date of data per month for a calculated column by each month

I am trying to get the max service date per month and load into a column.  I have this working in another workbook but it won't for some reason replicate.  My formula is 

 

MaxPerMonth = Calculate(Max(Members_Claims[SERVICE_DT]),FILTER('2017dates','2017dates'[YearMonth] = EARLIER('2017dates'[YearMonth])))

 

Which is giving me the max of the data in the entire dataset which is 11/1.  I am trying to have a column like this:

First Date     MaxDataPerMonth

1/1/2017     1/31/2017

2/1/2017     2/28/2017

.....

11/1/2017   11/1/2017  Because we only have data as of 11/1 right now.

Any ideas?  Thanks

1 ACCEPTED SOLUTION

Thanks for responding.  I tried your formula but it did not work but it gave me a jumpstart and I ended up with

 

DataDay = if(max(Members_Claims[SERVICE_DT])>'2017dates'[Date],Endofmonth(Members_Claims[SERVICE_DT]),MAX(Members_Claims[SERVICE_DT]))

 

which gave me 1/31/2017, 2/28/2017, .......11/1/2017 which is what I needed but it left me with some blank rows in the DataDay column so used the Summarize function to create a new table that eliminated the blank rows.

 

Thanks for your help!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @shelbsassy,

 

You can refer to below steps to simply get first date and max date of current month.

Steps:

1. Drag date column to table visual, switch it to hierarchy mode and keep year month.
2. Add above column twice to table visual, switch them to normal date mode and modify summary mode to 'earliest' and 'latest'.

2.PNG

calendar Last Date is 11/9/2017, so last month max date is 11/9/2017.

 

 

Regards,

Xiaoxin Sheng

Interkoubess
Solution Sage
Solution Sage

Hi @shelbsassy,

 

I created this column with this formula where I have got my table Data and its field Date. Please give us a dummy sample if it did not solve your problem.

 

Test =
IF (
    MAX ( Data[Date] ) > Data[Date],
    ENDOFMONTH ( Data[Date] ),
    MAX ( Data[Date] )
)

Thx

 

Ninter

Thanks for responding.  I tried your formula but it did not work but it gave me a jumpstart and I ended up with

 

DataDay = if(max(Members_Claims[SERVICE_DT])>'2017dates'[Date],Endofmonth(Members_Claims[SERVICE_DT]),MAX(Members_Claims[SERVICE_DT]))

 

which gave me 1/31/2017, 2/28/2017, .......11/1/2017 which is what I needed but it left me with some blank rows in the DataDay column so used the Summarize function to create a new table that eliminated the blank rows.

 

Thanks for your help!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors