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
jkesavan
Frequent Visitor

How to divide two columns from dashboard table

Hi all, 

 

i am struggling to divide two values from a table i have sorted and created using a matrix table. Its pretty easy to do it in Excel but i can't really understand how to make it work in PowerBI. 

 

For example i would like to do GM$ divide by Total Cost. However the table i have generated is a sum total of the values in EMP. If i manually add a extra column to do this , it does this for every single value instead of the the total sum i want from the table. Hopefully this makes sense.

 

jkesavan_0-1600747124743.png

jkesavan_3-1600747250568.png

 

GM% = ('Raw Data'[GM $]/'Raw Data'[Total Cost]) Syntax used to generate this. Although its clearly not correct. 

 

How i did it in excel to produce the correct results. 

jkesavan_1-1600747195257.png

jkesavan_2-1600747202845.png

 

 

1 ACCEPTED SOLUTION

@jkesavan , replace / with comma,

Check the formula I shared. I'm going through the data.

Check if the attachment can help

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@jkesavan , It should be like this, but Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

GM% = divide(sum('Raw Data'[GM $]),sum('Raw Data'[Total Cost]))

jkesavan_0-1600748882765.png

The relevant columns are GM $ and Total Cost. I have attached data in excel. 

JobSubC/HDivClientTotal CostGM $
1231C abc2314342
1231C abc86.5249.5
1231C abc51.82-14.82
1232C abc58.0422.26
1233C abc83.8518.35
1234C abc141.28199.72
1231C abc218.23382.73
       
       
       
       

@jkesavan , replace / with comma,

Check the formula I shared. I'm going through the data.

Check if the attachment can help

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.