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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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