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
C097986
Helper I
Helper I

return max date from mulitple colums only if all 4 columns have a date present

Hey guys,

       so i researched all over and i cannot get this formula to work.

I'm trying to get a date that shows the max date from 4 different columns, only if all 4 columns have dates present in them.

what i get is that i can get the max date of the 4 columns regardless if all 4 columns are completed or not.

for eg.

Capture.PNGso like you see in this picture, if there are 3 dates completed or even 1 date completed, it still give me a result in the last column. i only want it to give a result if all 4 columns are completed.

how can i alter this formula? any help would be appreciated.

 

Final_Approved_Time = Max(Max(AEF_REQUEST_FORM_DATA[PAIImpApproved],AEF_REQUEST_FORM_DATA[SAImpApproved]),Max(AEF_REQUEST_FORM_DATA[RGImpApproved],AEF_REQUEST_FORM_DATA[CIImpApproved]))

3 REPLIES 3
Greg_Deckler
Super User
Super User

Use my MC Aggregations Quick Measure and insert a COUNTROWS check to make sure that you have 4 rows.

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

i came across another problem when i use this formula to achieve the above problem.

Final_Approved_Time = IF(AEF_REQUEST_FORM_DATA[STATUS]="Approved",Max(Max(AEF_REQUEST_FORM_DATA[PAImpApproved],AEF_REQUEST_FORM_DATA[SAImpApproved]),Max(AEF_REQUEST_FORM_DATA[RGImpApproved],AEF_REQUEST_FORM_DATA[CIImpApproved])),0)

 

Capture.PNG

this is the data that i get when i use the above formula. As you can see that it gives me the right value when all 4 colums are filled: 7/10/2018. But when it's any other case, then it just give me a generic value of 12/30/1899. i put in the formula that i want to see a 0 or even blank is ok instead of this value, but i dont know where i went wrong.

 

can anyone help me through this?

thank you in advance.

thank you. this helped a lot. i aggregated, then used a count with a max. it worked. thank you

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.

Top Solution Authors