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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Luis_Caston
Helper II
Helper II

Sum by TOPN and Keep the total of all clients

Dear all,

I've the next problem:
I want to filter by TOP 5 clients but I want to keep the total. If I introduce a filter here, the total is only the total of the clients filtered.

Luis_Caston_0-1708526912171.png

Do you know how can I sum by Top 5 clients (making a ranking for example as TOP 5 & Others by sales and make another category as "other" to keep the whole total?

 

I add a pbix Sum by ranking 

1 ACCEPTED SOLUTION

You may create a measure for this:

Suma de Sales Percentage = 
    DIVIDE( 
        SUM( Tabla[Sales] ),
        CALCULATE( SUM( Tabla[Sales] ), ALL( Tabla ) )
    )

View solution in original post

6 REPLIES 6
Luis_Caston
Helper II
Helper II

Dear @timalbers @nsexton12 thank you for your support.

I've tryed both options and I've the next doubts:

Luis_Caston_0-1708600705677.png

@timalbersI'd like to see the whole total (450) but at the same time the % of the total (450) with the TOP 5 clients, not the % of the total filtered that is the point 1 (White 25% is the % of the total of this TOP 5 clients). Do you know how to do it?

 

@nsexton12I'm thinking if not do it in this way, I'll put the total in millions and total million, but I'd like to do it in % as in the first option. Do you also know how to do it?

You may create a measure for this:

Suma de Sales Percentage = 
    DIVIDE( 
        SUM( Tabla[Sales] ),
        CALCULATE( SUM( Tabla[Sales] ), ALL( Tabla ) )
    )

You got it!!!

Thank you so much that is what I was looking for!!

Great!!

Luis_Caston_0-1708604655657.png

I've updated the pbix if someones needs it.

Thank you again guys! appreciate!

timalbers
Advocate V
Advocate V

Additionally, if you wish to have the number in the same table visual, you could add a measure like this:

Suma de Sales = 
    IF( 
        ISINSCOPE( Tabla[Client] ), 
        BLANK(), 
        CALCULATE( 
            SUM( Tabla[Sales] ), ALL( Tabla )
        )
    )

Then you could add this measure as additional column to your table visual.

 

The grand total will then only show for the total row and be blank for each client.

nsexton12
Resolver II
Resolver II

Have you thought about turning the sum column option off for the table and creating a new measure that is the sum of all sales? You could put on a data card that is directly beneath the table to keep the value in the same area. The formula would be generally structured as CALCULATE(SUM(Table[Sales]),ALL(Table)). If this answers your question, please mark as a solution!

It would look roughly like this. Sum Example.png

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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