cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Partisan
Post Partisan

Dax for maxif

Hi,

 

Please can you tell me the dax formula to find the column "Maximum Sales In Area"? (for each row it should find the maximum number of sales for the branch with the most sales in the same area)

 

Branch | Area | Sales | Maximum Sales In Area

1 | North | 20 | 40

2 | North | 40 | 40

3 | North | 35 | 40

4 | South | 5 | 12

5 | South | 12 | 12

6 | South | 8 | 12

 

Thanks,

 

CM

 

p.s. I've tried the CALCLATE function with MAX and FILTER but it doesn't allow me to specifiy a different value condition for each row.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Dax for maxif

@CloudMonkey

 

 

Hi, lets try with:

Calculated Column

 

MaximumSalesinArea =
CALCULATE (
    MAX ( Table2[Sales] );
    FILTER ( Table2; Table2[Area] = EARLIER ( Table2[Area] ) )
)

 

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

1 REPLY 1
Highlighted
Community Champion
Community Champion

Re: Dax for maxif

@CloudMonkey

 

 

Hi, lets try with:

Calculated Column

 

MaximumSalesinArea =
CALCULATE (
    MAX ( Table2[Sales] );
    FILTER ( Table2; Table2[Area] = EARLIER ( Table2[Area] ) )
)

 

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors