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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
C097986
Helper I
Helper I

Average of Max Date taken from 4 different columns

Hello,

   I am stuck trying to make an average of the maximum date that is taken from 4 different columns.

I have 4 different columns of approved dates as a subdivision and i want to take the max from all the columns and then show that as average in each month. While some have blank values as well in them. So how do I measure or calculate all these factors in one?

 

So basically i was trying to get one different column to tell me the max date of each row (keeping null values in account). From that column, I hope to make an average count to filter by month.

Any help would be appreciated.

Thank you

 

A ApprovedB ApprovedC ApprovedD Approved   
5/31/20175/31/2017 5/30/20175/31/2017  
3/2/20183/6/20183/6/20183/3/20183/6/2018  
8/8/20178/10/20178/8/2017 8/10/2017  
3/15/20183/15/20183/17/20183/18/20183/18/2018  
     average= May=1
      March=2
      August=1
2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

@C097986

 

Try this Column

 

Max Date =
VAR temp = {
        Table1[A Approved],
        Table1[B Approved],
        Table1[C Approved],
        Table1[D Approved] }
RETURN
    MAXX ( temp, [Value] )

View solution in original post

Hi @C097986

 

When i use above sample data...i get correct results... see the pic below

 

Maxofdates.png

View solution in original post

10 REPLIES 10
Zubair_Muhammad
Community Champion
Community Champion

@C097986

 

Try this Column

 

Max Date =
VAR temp = {
        Table1[A Approved],
        Table1[B Approved],
        Table1[C Approved],
        Table1[D Approved] }
RETURN
    MAXX ( temp, [Value] )

Thank you, that worked. I was doing only the max function and didn't think about using var temp. this is great.

So i could just take this data calculated and filter it in visulaziation to come up with the average per month, correct.

@Zubair_Muhammad

 

Do you know how I would ensure that any blanks are not accounted for in this formula? When i do this, I get what i was looking for but columns that are blanks with no value, I get a result of eg 1793 for the dates. so i need that to not happen. any suggestions?

@C097986

 

Try this to ignore the BLANKS

 

Column =
VAR temp = {
        Table1[A Approved],
        Table1[B Approved],
        Table1[C Approved],
        Table1[D Approved] }
RETURN
    MAXX ( FILTER ( temp, [Value] <> BLANK () ), [Value] )

it does not work. I am still getting odd values.

@C097986

 

Could you show me a screenshot of what results you get and what you expect?

 so this is what i'm expecting to get as a result.

eg. first row column is blank but the result (in red) still gives me the latest date.

A ApprovedB ApprovedC ApprovedD Approved   
5/31/20175/31/2017 5/30/20175/31/2017  
3/2/20183/6/20183/6/20183/3/20183/6/2018  
8/8/20178/10/20178/8/2017 8/10/2017  
3/15/20183/15/20183/17/20183/18/20183/18/2018  
     average= May=1
      March=2
      August=1

 

 

this is what i'm getting:

 

A ApprovedB ApprovedC ApprovedD Approved   
5/31/20175/31/2017 5/30/20179/31/1783  
3/2/20183/6/20183/6/20183/3/20183/6/2018  
8/8/20178/10/20178/8/2017 4/10/1798  
3/15/20183/15/20183/17/20183/18/20183/18/2018  
      
       
       

i just get a random date automatically populated.

Hi @C097986

 

When i use above sample data...i get correct results... see the pic below

 

Maxofdates.png

thanks. i was misspelling. my bad

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.