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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anshenterprices
Helper IV
Helper IV

dax to calculated 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%


1 REPLY 1
Fowmy
Super User
Super User

@Anshenterprices 

Create the following measure:

top 3 customers % = 
var __top3 = 
CALCULATE(
    SUM('Customer Table'[Sales]),
    TOPN(3,VALUES('Customer Table'),CALCULATE( SUM('Customer Table'[Sales] )))
)

var __total =     SUM('Customer Table'[Sales])

return
    DIVIDE(  __top3 , __total )

Fowmy_0-1623409328777.png

 



 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.