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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
PoorBIGuy
Frequent Visitor

How to apply the maximum and pick the "winner" in BI?

Hi Fellas,

 

I am see this kind of table in BI:

PoorBIGuy_0-1714503198692.png

 

Basically, I want to see which region generates the most revenue for each sales rep. For example, for sales rep A, it's "Central" so I hope the BI formula will return "Central"; for sales rep B, it's "east coast".

 

Is there a way to do it in BI?

 

Thanks!

2 ACCEPTED SOLUTIONS
v-zhouwen-msft
Community Support
Community Support

Hi @vicky_ ,thanks for the quick reply, I'll add further.

Hi @PoorBIGuy ,

The Table data is shown below:

vzhouwenmsft_0-1714543226132.png

Please follow these steps:
1. Use the following DAX expression to create a measure

Measure = 
VAR _a = MAX('Table'[Sales])
VAR _b = CONCATENATEX(FILTER('Table','Table'[Sales] = _a),'Table'[Region],",")
RETURN _b

2.Final output

vzhouwenmsft_1-1714543283333.png

 

View solution in original post

OK so then you can sum the sales per region and customer and then grab the related region by max sales. 

 
Region with Most Sales per Customer = CALCULATE(MAX('Table'[Region]), TOPN(1, SUMMARIZE('Table', 'Table'[Customer], 'Table'[Region], "sales", SUM('Table'[Sales])), [sales], DESC))

View solution in original post

5 REPLIES 5
v-zhouwen-msft
Community Support
Community Support

Hi @vicky_ ,thanks for the quick reply, I'll add further.

Hi @PoorBIGuy ,

The Table data is shown below:

vzhouwenmsft_0-1714543226132.png

Please follow these steps:
1. Use the following DAX expression to create a measure

Measure = 
VAR _a = MAX('Table'[Sales])
VAR _b = CONCATENATEX(FILTER('Table','Table'[Sales] = _a),'Table'[Region],",")
RETURN _b

2.Final output

vzhouwenmsft_1-1714543283333.png

 

I think one thing is missing then the sales from one region should be a sum. For A, total sales from Central is 310 (150+80+80) and West is 250 (150+100) so eventually, only "Central" should return

OK so then you can sum the sales per region and customer and then grab the related region by max sales. 

 
Region with Most Sales per Customer = CALCULATE(MAX('Table'[Region]), TOPN(1, SUMMARIZE('Table', 'Table'[Customer], 'Table'[Region], "sales", SUM('Table'[Sales])), [sales], DESC))
vicky_
Super User
Super User

Try the following measure:

Region with Most Sales per Customer = CALCULATE(MAX('Table'[Region]), TOPN(1, 'Table', 'Table'[Sales], DESC))

Unfortunately, this doesn't work

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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