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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anshenterprices
Helper IV
Helper IV

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

Source Table

DateCategorycustomore nameSales
4/6/2021Equitya123
4/6/2021Equityb345
4/6/2021Equityc567
4/6/2021Equityd789
4/6/2021Equitye1011
4/6/2021Equityf1233
4/6/2021Equityg1455
4/6/2021Equityh1677
4/6/2021Equityi1899
4/6/2021Equityj2121
4/6/2021Equityk2343
4/6/2021Equityl2565
4/6/2021Commodityd453
4/6/2021Commoditye564
4/6/2021Commodityf234
4/6/2021Commodityg453
4/6/2021Commodityh564
4/6/2021Commodityi234
4/6/2021Commoditya399
4/6/2021Commodityb564
4/6/2021Commodityc729
5/6/2021Equityg894
5/6/2021Equityh1059
5/6/2021Equityi1224
5/6/2021Equityj342
5/6/2021Equityl1554
5/6/2021Equityd1719
5/6/2021Equitye1884
5/6/2021Equityf2049
5/6/2021Equityg2214
5/6/2021Equityh234
5/6/2021Equityi2544
5/6/2021Equityk2565



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
v-deddai1-msft
Community Support
Community Support

Hi @Anshenterprices ,

 

Please use the following measure:

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

 

Capture19.PNG

 

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

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-deddai1-msft
Community Support
Community Support

Hi @Anshenterprices ,

 

Please use the following measure:

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

 

Capture19.PNG

 

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

MintuBaruah
Helper III
Helper III

Hi @Anshenterprices 

 

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!

amitchandak
Super User
Super User

@Anshenterprices , Try a measures like

 

Sales M = sum(Table[Sales])

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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