cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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

Highlighted
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
Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 371 members 4,040 guests
Please welcome our newest community members: