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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Help Making a % of Total Column with only Top 30 Items

HI - 

 

I am trying to create a % of Total column for (YTD sales figures for ONLY Blue in Top 30)/(YTD Sales for Blue and Red for all rankings).

 

The Blue filter is a pagewide filter currently.

 

I am having trouble finding a way to divide by the full total amount for both red and blue and not only top 30.

 

Does anyone have any suggestions?  

 

Thanks, 

 

H

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

g1.png

 

You may create a measure as below.

% Total Sales = 
DIVIDE(
    SUM('Table'[Sales]),
    CALCULATE(
        SUM('Table'[Sales]),
        ALL('Table')
    )
)

 

Result:

g2.png

 

Best Regards

Allan

 

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

View solution in original post

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

g1.png

 

You may create a measure as below.

% Total Sales = 
DIVIDE(
    SUM('Table'[Sales]),
    CALCULATE(
        SUM('Table'[Sales]),
        ALL('Table')
    )
)

 

Result:

g2.png

 

Best Regards

Allan

 

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

amitchandak
Super User
Super User

@Anonymous , then a measure like this should work

 

% of total = divide([sales],[all City]) //all City =CALCULATE([Sales],all(Geography))

amitchandak
Super User
Super User

@Anonymous , you can use topN for that

example

Top 30 City Rank = CALCULATE([Sales],TOPN(30,all(Geography[City]),[Sales],DESC),VALUES(Geography[City Id]))

all City  =CALCULATE([Sales],all(Geography))

 

% of Top 30 = divide([Top 30 City Rank],[all City])

 

https://youtu.be/QIVEFp-QiOk

Anonymous
Not applicable

Thanks for the suggestions! I think i was unclear with my question -- I have added a screen shot below to try to illustrate.  I need to get the % for each line, not just the overall top 30.  I have used top 5 in the example below

 

pbhg1_0-1605323135877.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.