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

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] )

Regards
Zubair

Please try my custom visuals

View solution in original post

Hi @C097986

 

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

 

Maxofdates.png


Regards
Zubair

Please try my custom visuals

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] )

Regards
Zubair

Please try my custom visuals

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] )

Regards
Zubair

Please try my custom visuals

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?


Regards
Zubair

Please try my custom visuals

 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


Regards
Zubair

Please try my custom visuals

thanks. i was misspelling. my bad

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.