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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

How to add a percentage of data covered to a chart

I think this would be a relatively simple process but am unable to figure it out. I have a donut chart that shows the sum of data from the table below (sample).

 

IDOfficeSalesSales Type
1NYC10,000Online
2LA25,000Store
3LA10,000Online
4NYC5,000Store

 

My donut chart shows the make up of total sales from Sales Type, and is filtered on the NYC office only.

 

I want to add a card visual that shows that in this filtered bar chart, 30% of sales is explained. (NYC has 30% of total sales). When I add the sales variable to the card visual and then change it to 

I am trying to add a card type visual that shows that out of all sales, NYC contains 40% of total sales. Currently I am adding a card that shows sum of sales as a percentage of grand total. However, it always just shows 100%.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create a measure as below to get the percentage, please find the details in the attachment.

Percentage = 
VAR _persales =
    SUM ( 'Table'[Sales] )
VAR _allsales =
    CALCULATE ( SUM ( 'Table'[Sales] ), ALL ( 'Table' ) )
RETURN
    DIVIDE ( _persales, _allsales )

yingyinr_0-1671606821219.png

If the above one can't help you get the desired result, please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

You can create a measure as below to get the percentage, please find the details in the attachment.

Percentage = 
VAR _persales =
    SUM ( 'Table'[Sales] )
VAR _allsales =
    CALCULATE ( SUM ( 'Table'[Sales] ), ALL ( 'Table' ) )
RETURN
    DIVIDE ( _persales, _allsales )

yingyinr_0-1671606821219.png

If the above one can't help you get the desired result, please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community.

How to upload PBI in Community

Best Regards

Shaurya
Memorable Member
Memorable Member

Hi @Anonymous,

 

Create a sales measure that ignores the filter context.

 

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

 

Screenshot 2022-12-20 212103.jpg

 

Then for percentage, you create formula that takes [_Sales]/[Total Sales]

 

Works for you? Mark this post as a solution if it does!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.