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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AnandRanga
Helper III
Helper III

How to calculate % from a column?

this is my sample data and it is very simpleCapture.jpgI have 2 columns a and b, then i created third column b/a, in percentage column i put the formula like this:

((value of b/a)/ sum of b/a column)*100

 

(28/420.31)*100 =6.66

the same thing i want to achieve in power BI. I am using quick calc functionality but that is showing 100% only for every record. Where i am doing wrong?

 Thanks for your time.

 

 

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

HI @AnandRanga

 

I took the first three columns of your sample data and created a table.

 

I then added a calculated column as follows and formatted accordingly.

 

b/a = DIVIDE(
		'Table2'[a],
		'Table2'[b]
		)

Then I added the following calculated measure

 

 

Percentage = DIVIDE(
			CALCULATE(
				SUM('Table2'[b/a])
				),
				CALCULATE(
					SUM('Table2'[b/a]),
					ALL(table2)
					)
				)

Which gave me the following

 

percentage.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

1 REPLY 1
Phil_Seamark
Employee
Employee

HI @AnandRanga

 

I took the first three columns of your sample data and created a table.

 

I then added a calculated column as follows and formatted accordingly.

 

b/a = DIVIDE(
		'Table2'[a],
		'Table2'[b]
		)

Then I added the following calculated measure

 

 

Percentage = DIVIDE(
			CALCULATE(
				SUM('Table2'[b/a])
				),
				CALCULATE(
					SUM('Table2'[b/a]),
					ALL(table2)
					)
				)

Which gave me the following

 

percentage.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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