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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bundipapa
Helper I
Helper I

Create a max if logic per category

Hello,

 

this might be the stupidest question, but I need to recreate a maxif logic from excel showing the produt, that had the highest revenue within a deal.

Here is an example dataset in excel, that is identical in form to what I have in Power BI

bundipapa_0-1680177979154.png

In excel I would add a column showing the highest revenue for each deal

bundipapa_1-1680178090104.png

And then check if the revenue for the given row is equal to the maximum for the dea. If yes, that product has the highest and is marked, if not, I leave it empty.

bundipapa_2-1680178175260.png

 

Is there a way to recreate this in power BI with the intial dataset?  I would need the exact same result.

Thank you for any help!



 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @bundipapa 

 

Download example PBIX file

 

You can do the MAXIF like this

 

Maxif = CALCULATE(MAX('DataTable'[Revenue]), FILTER(ALL('DataTable'), 'DataTable'[Deal] = SELECTEDVALUE('DataTable'[Deal])))

 

 

and the Highest Product column like this

 

Highest Product Within Deal = IF([Maxif] = SELECTEDVALUE('DataTable'[Revenue]), "Y")

 

 

maxif.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @bundipapa 

 

Download example PBIX file

 

You can do the MAXIF like this

 

Maxif = CALCULATE(MAX('DataTable'[Revenue]), FILTER(ALL('DataTable'), 'DataTable'[Deal] = SELECTEDVALUE('DataTable'[Deal])))

 

 

and the Highest Product column like this

 

Highest Product Within Deal = IF([Maxif] = SELECTEDVALUE('DataTable'[Revenue]), "Y")

 

 

maxif.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors