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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Dax Help!!

Hi,

 

I'm looking for a DAX formula which can help me get the below mentioned results.

 

Account NameCountryRevenue 
XYZSingapore1000Ignore This
XYZThailand800Ignore This
XYZVietnam900Ignore This
XYZSri Lanka1200Consider this
ABCSingapore400Consider this
DEFPhilippines200Consider this

 

For example, there's an account with multiple engagements in different locations. I should consider the account with highest revenue in a given location and ignore the rest.

 

Any help on this would be really appreciated!!

 

Thanks in advance!

 

Regards,

Mahesh

1 ACCEPTED SOLUTION

@Anonymous ,

new column =
var _max = maxx(filter(Table, [Account Name] = earlier([Account Name])),[Revenue])
return
if( [Revenue] =_max, [Country],blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

 

Please check the below measure.

 

Picture3.png

 

Result Measure =
VAR currentaccount =
MAX ( 'Table'[Account Name] )
VAR maxrevbyacount =
GROUPBY (
FILTER ( ALL ( 'Table' ), 'Table'[Account Name] = currentaccount ),
'Table'[Account Name],
"@maxrev", MAXX ( CURRENTGROUP (), 'Table'[Revenue] )
)
RETURN
IF (
SUM ( 'Table'[Revenue] ) = MAXX ( maxrevbyacount, [@maxrev] ),
"Consider this",
"Ignore This"
)

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: https://www.linkedin.com/in/jihwankim1975/


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Anonymous
Not applicable

hi @Jihwan_Kim ,

 

Thank you for responding so quickly.

 

I'm looking for the result as below:

 

Account NameCountryRevenueCountry_Result
XYZSingapore1000 
XYZThailand800 
XYZVietnam900 
XYZSri Lanka1200Sri Lanka
ABCSingapore400Singapore
DEFPhilippines200Philippines

 

If the the critiria isn't matching, I should get a blank else the Country name.

amitchandak
Super User
Super User

@Anonymous , Try like

new column =
var _max = maxx(filter(Table, [Account Name] = earlier([Account Name])),[Revenue])
return
if( [Revenue] =_max, "Consider this", "Ignore This")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak ,

 

Thank you for your swift response.

 

I'm looking for the result as below:

 

Account NameCountryRevenueCountry_Result
XYZSingapore1000 
XYZThailand800 
XYZVietnam900 
XYZSri Lanka1200Sri Lanka
ABCSingapore400Singapore
DEFPhilippines200Philippines

 

If the the critiria isn't matching, I should get a blank else the Country name.

@Anonymous ,

new column =
var _max = maxx(filter(Table, [Account Name] = earlier([Account Name])),[Revenue])
return
if( [Revenue] =_max, [Country],blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.