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
Cgowdar
Frequent Visitor

Top customers who are contributing to the 80% of the total amount

Following is the sample data used in the report to find the Top customers who are contributing to the 80% of the total amount

 

YearMonthCustomerAmount INRAmount USD
2017FebCustomer 16500108
2017FebCustomer 3500083
2017JanCustomer 3450075
2017JanCustomer 2300050
2017FebCustomer 2250042
2017MarCustomer 1250042
2017FebCustomer 4230038
2017AprCustomer 2230038
2017AprCustomer 1220037
2017JanCustomer 1200033
  100% Amount32800547
  80% Amount26240437

 

 

Would like to find find out who are those customers who will full fill the 80% of the total amount in the desc order for both INR and USD

 

Report consists of calender , currency type and customers filter

 

any solution on this will be very helpfull

 

Thanks in advance

 

 

2 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

Hi @Cgowdar

 

See the attached file

(With your sample date)

 

I hope this will help although your original model would be complex

 

111.png

 

 

 

 

View solution in original post

@Cgowdar

 

Here is what I have Done

 

1) RANK the Customers based on AMOUNT (lets say INR)

 

RANK INR =
IF (
    HASONEVALUE ( TableName[Customer] ),
    RANKX (
        ALLSELECTED ( TableName[Customer] ),
        CALCULATE ( SUM ( TableName[Amount INR] ) ),
        ,
        DESC,
        DENSE
    )
)

2) Add Cumulative Totals using RANK from 1st to last Ranked Customer

 

CumulativeTotals =
VAR CurrentRANK = [RANK INR]
RETURN
    SUMX (
        FILTER (
            ALLSELECTED ( TableName[Customer] ),
            CALCULATE ( [RANK INR] ) <= CurrentRANK
        ),
        CALCULATE ( SUM ( TableName[Amount INR] ) )
    )

3) Last step..Cumulative contribution by each Customer based in order of their RANK

 

Cumulative Percentage =
[CumulativeTotals]
    / CALCULATE ( SUM ( TableName[Amount INR] ), ALLSELECTED ( TableName[Customer] ) )

View solution in original post

7 REPLIES 7
Zubair_Muhammad
Community Champion
Community Champion

Hi @Cgowdar

 

See the attached file

(With your sample date)

 

I hope this will help although your original model would be complex

 

111.png

 

 

 

 

 Hi 

 

Is there a way to  filter by top x%, but default setting should be to show top 80%. Filter should allow 10-100% and in 10% increments?

 

Thanks

Simona


@Zubair_Muhammad wrote:

Hi @Cgowdar

 

See the attached file

(With your sample date)

 

I hope this will help although your original model would be complex

 

111.png

 

 

 

 



@Zubair_Muhammad wrote:

Hi @Cgowdar

 

See the attached file

(With your sample date)

 

I hope this will help although your original model would be complex

 

111.png

 

 

 

 


 

@Cgowdar

 

Here is what I have Done

 

1) RANK the Customers based on AMOUNT (lets say INR)

 

RANK INR =
IF (
    HASONEVALUE ( TableName[Customer] ),
    RANKX (
        ALLSELECTED ( TableName[Customer] ),
        CALCULATE ( SUM ( TableName[Amount INR] ) ),
        ,
        DESC,
        DENSE
    )
)

2) Add Cumulative Totals using RANK from 1st to last Ranked Customer

 

CumulativeTotals =
VAR CurrentRANK = [RANK INR]
RETURN
    SUMX (
        FILTER (
            ALLSELECTED ( TableName[Customer] ),
            CALCULATE ( [RANK INR] ) <= CurrentRANK
        ),
        CALCULATE ( SUM ( TableName[Amount INR] ) )
    )

3) Last step..Cumulative contribution by each Customer based in order of their RANK

 

Cumulative Percentage =
[CumulativeTotals]
    / CALCULATE ( SUM ( TableName[Amount INR] ), ALLSELECTED ( TableName[Customer] ) )

I signed in to give you an upvote. 

Hi @Zubair_Muhammad, I have calculated the cumulated  %. How do I calculate the count of customers contributing to 80% of value.

I have used this Dax

80% = COUNTROWS(FILTER(VALUES('Table'[Customer Name]),[Cumulative Percentage]<=0.8)).
You help is highly appreciated.

@Zubair_Muhammad 

please share pbix file, its not found in one drive, I am looking on same requirement

This worked like a Pro.

 

Thanks a lot for your valuable reply.

 

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!

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.