cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Dat_Data Frequent Visitor
Frequent Visitor

Summarize and MAX not functioning as expected

Hi, 

 

I have a table that looks like this

 

IDDateGenderSub-District

11/8/2019MA
22/8/2019MA
33/8/2019MB
43/8/2019FB
53/8/2019FB
610/8/2019FC
710/8/2019MC
821/8/2019FD
921/8/2019MD
1025/8/2019MD

 

I've ran the following table DAX query and got the following result: 

 

Table 6 = SUMMARIZE('table','table'[Sub-District],"Start_Date",MIN('table'[Date]),"End_Date",MAX('Table 2'[Date]),"Male",CALCULATE(count('table'[Gender]),'table'[Gender]="M"),"Female",CALCULATE(count('table'[Gender]),'table'[Gender]="F"))

 

Sub-DistrictEnd_DateMaleFemaleStart_Date

Sub-DistrictStart_DateEnd_DateMaleFemale
A1/8/2019 0:0025/8/2019 0:002 
B3/8/2019 0:0025/8/2019 0:0012
C10/8/2019 0:0025/8/2019 0:0011
D21/8/2019 0:0025/8/2019 0:0021

 

As you can note the MAX date column is not returning the right result as it basically maxed the date across the entire column. 

 

Any help would be appreciated.

 

Best,

Dat_Data

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Summarize and MAX not functioning as expected

Hi @Dat_Data 

For End_Date you are using Table 2 instead of  table:

"End_Date"MAX ( 'Table 2'[Date] )

When you SUMMARIZE over ' table',  you have no filters applied on Table 2, unless there's a relationship

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Summarize and MAX not functioning as expected

Hi @Dat_Data 

For End_Date you are using Table 2 instead of  table:

"End_Date"MAX ( 'Table 2'[Date] )

When you SUMMARIZE over ' table',  you have no filters applied on Table 2, unless there's a relationship

View solution in original post

Dat_Data Frequent Visitor
Frequent Visitor

Re: Summarize and MAX not functioning as expected

Wow..feeling a bit werid now... - completely missed this! thanks @AlB 

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 66 members 1,238 guests
Please welcome our newest community members: