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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

sum of 20%

Hi, 

I m using the following measure to get the sales of top 20% customers. How do I sum the sales of these 20% and show as a % of the total sales:

sales of 20% = if(ISBLANK([salesttl]), Blank(),IF(RANKX(all(dProducts), [salesttl], , DESC) < (CALCULATE([UniqueProduct], all(dProducts))*.2,[salesttl],BLANK()))
 
Divide is not working. I simply get 100%
4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

Tough to say. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

But generally you would want something like:

 

% of Total = DIVIDE([sales of 20%],SUMX(ALL('Table'),[Sales]),0)



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi Thanks @Greg_Deckler  , But thats also giving me 100. My data is looking something like this with the measure I provided in post:

 

ClusterProduct% of total mkt salesTop 20% sales
MAProd 115.54%491,278
MAProd 211.36%359,314
MAProd 38.15%257,596
MAProd 46.69%211,559
MAProd 56.53%206,382
MAProd 66.14%194116
  100%50,000,000

 

Market sales: 3.2 million

total regional sales: 50M

MX sales contr of top 20% products to regional sales : 1,720,245/50m = 3.4% >> I would like to show this result in the card.

 

Also, in the table I m seeing the regional sales in the total instead of the market total sales and in the % column  I'm seeing the sales as % of the market sales (3.2m) but in total it is showing 100% (when in fact it is around 54%)

Hi @Anonymous 

I don't kwow how to define the top20% product?

It is defined by "market sales" or "top20% sales"?

You could show some short raw data for me to test.

 

Best Regards

Maggie

Right, again, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Sample source data, otherwise it's just pure guessing and likely going to be wrong.

 

Have you looked at the drop down for the column and the "Show value as" and then Percent of Grand Total?

 

See the attached PBIX that provides a DAX solution as well as the Show As method.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.