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
Anonymous
Not applicable

max if calculated column

 

Hi,

 

Want some help with creating a calculated column (not a measure). To explain I have recreated dummy data below. I have a column of data displaying the centre and a column displaying a submission month. What I'm looking for is a way to create the third column below. I want it to do is determine if the submission month is the latest submission (or most recent) by centre. So in the example below Perth has no Septmber 2017 submission so the latest submission for Perth is August 2017.

 

CentreSubmission MonthSubmission
SydneyMay-17Previous Submission
BrisbaneJun-17Previous Submission
PerthJul-17Previous Submission
DarwinAug-17Previous Submission
MelbourneSep-17Previous Submission
SydneyJun-17Previous Submission
BrisbaneJun-17Previous Submission
PerthJun-17Previous Submission
DarwinJun-17Previous Submission
MelbourneJun-17Previous Submission
SydneyJul-17Previous Submission
BrisbaneJul-17Previous Submission
PerthJul-17Previous Submission
DarwinJul-17Previous Submission
MelbourneJul-17Previous Submission
SydneyAug-17Previous Submission
BrisbaneAug-17Previous Submission
PerthAug-17Latest Submission
DarwinAug-17Previous Submission
MelbourneAug-17Previous Submission
SydneySep-17Latest Submission
BrisbaneSep-17Latest Submission
DarwinSep-17Latest Submission
MelbourneSep-17Latest Submission
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula

 

=if(CALCULATE(MAX([Submission Month]),FILTER(Data,Data[Centre]=EARLIER(Data[Centre])))=[Submission Month],"Latest submission","Previous month")

Please note that the answer in the 5th row will also be Latest submission becausee the date is Sep-17.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula

 

=if(CALCULATE(MAX([Submission Month]),FILTER(Data,Data[Centre]=EARLIER(Data[Centre])))=[Submission Month],"Latest submission","Previous month")

Please note that the answer in the 5th row will also be Latest submission becausee the date is Sep-17.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

this is not working now..... I now have data for October 2017 in the and September 2017 is showing as the latest month and October is labelled as previous month

Hi,

 

Share the link from where i can download your file.  Also, point out the mistake in the result which you get by my formula.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.