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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
CloudMonkey
Post Prodigy
Post Prodigy

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
Vvelarde
Community Champion
Community Champion

@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

2 REPLIES 2
johnajoseph
Regular Visitor

Hmm... for me, those semicolons needed to be commas. But otherwise worked.

Vvelarde
Community Champion
Community Champion

@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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.