cancel
Showing results for
Did you mean:
Helper III

## dax to calculate top 3 customer name by sales filtered by category and date

Source Table

 Date Category customore name Sales 4/6/2021 Equity a 123 4/6/2021 Equity b 345 4/6/2021 Equity c 567 4/6/2021 Equity d 789 4/6/2021 Equity e 1011 4/6/2021 Equity f 1233 4/6/2021 Equity g 1455 4/6/2021 Equity h 1677 4/6/2021 Equity i 1899 4/6/2021 Equity j 2121 4/6/2021 Equity k 2343 4/6/2021 Equity l 2565 4/6/2021 Commodity d 453 4/6/2021 Commodity e 564 4/6/2021 Commodity f 234 4/6/2021 Commodity g 453 4/6/2021 Commodity h 564 4/6/2021 Commodity i 234 4/6/2021 Commodity a 399 4/6/2021 Commodity b 564 4/6/2021 Commodity c 729 5/6/2021 Equity g 894 5/6/2021 Equity h 1059 5/6/2021 Equity i 1224 5/6/2021 Equity j 342 5/6/2021 Equity l 1554 5/6/2021 Equity d 1719 5/6/2021 Equity e 1884 5/6/2021 Equity f 2049 5/6/2021 Equity g 2214 5/6/2021 Equity h 234 5/6/2021 Equity i 2544 5/6/2021 Equity k 2565

I need a top 3 customer name by sales and filtered by category and date divided by total sales  filtered by category and date

eg. date 4/6/2021 top 3  customer sales =7029 for category equity divided by totalsales of equity category and date4/6/2021  is 16128
o/p= 7029/16128
= 44%

2 ACCEPTED SOLUTIONS
Community Support

``Measure = DIVIDE(SUMX(TOPN(3,'Table',CALCULATE(SUM('Table'[Sales]))),'Table'[Sales]),SUM('Table'[Sales]))``

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,

Dedmon Dai

Super User III

Hi,

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
4 REPLIES 4
Super User III

Hi,

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Community Support

``Measure = DIVIDE(SUMX(TOPN(3,'Table',CALCULATE(SUM('Table'[Sales]))),'Table'[Sales]),SUM('Table'[Sales]))``

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,

Dedmon Dai

Helper II

For your measure, You can use TOPN Dax formula to calculate the top 3 customer names by sales.

Regards,

Mintu Baruah

If you find the solution useful please mark my post as a solution!
In doing so, you are also helping me. Thank you!

Super User IV

@Anshenterprices , Try a measures like

Sales M = sum(Table[Sales])

CALCULATE([Sales M],TOPN(10,allselected(Table[Customer]),[Sales M],DESC),VALUES(Table[Customer]))

Proud to be a Super User!

Announcements

#### Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.