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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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