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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
wokka
Helper IV
Helper IV

Dax/method needed to calculate percentages from table

I'm trying to work out how to calculate percentages from a simple table in powerbi desktop.

 

I click on "Table" under visualizations and create a table.

Then I drag and drop a measure called 'Sales' into the table,

then drag and drop in a then drop in Sales_Confirmed  dimension,

then drag and drop in Month dimension into the table.

 

This is what it looks like after the table is built:

 

Month      Sales            Sales_Confirmed 

1               100,000       true

2               200,000       true

3               500,000       true

Total         800,000   

 

What I am trying to do is work out how to create a new column in the table that is the percentage of total for month 1,2 & 3.

So month 1 percentage would be   100000/800000 * 100 = 12.5%     and so on.

 

Then I need some way to calculate & add the percentage column values in the table itself as so I can graph them?

Where I get stuck is working out how to get 800,000 total value to use for a calculated column. 

I dont want to hard code in 800,000 as the page also has a slicer that can vary the year.

 

Can someone assist please? 

 

 

   

 

1 ACCEPTED SOLUTION
Vijay_Chethan
Super User
Super User

You can use ALL() function in dax
create a measure to calculate total sales irrespective of filter use
Total_sales=calculate(sum(sales),ALL('table_name'))
now for the percentage u can do the following
sales%=sum(sales)/Total_sales


if this helps please masrk as solution

View solution in original post

2 REPLIES 2
BIswajit_Das
Super User
Super User

Hello @wokka,
As per your requirement you're creating a calculated column and you need the total value i.e 800000
so Below is the DAX for calculated column which returns the total value;

total=
CALCULATE([sales], ALL('Table'))

If you need any further assistance please let me know.
Thanks & Regards.
 
Vijay_Chethan
Super User
Super User

You can use ALL() function in dax
create a measure to calculate total sales irrespective of filter use
Total_sales=calculate(sum(sales),ALL('table_name'))
now for the percentage u can do the following
sales%=sum(sales)/Total_sales


if this helps please masrk as solution

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.