cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

dax divide multiple columns

Hello, I would like to create a column Result. I wrote formulas into the column. 

 

SourcePrice (col B)Profit (col C)Result
Facebook20005000108,70% (=C2/$C$6/(B2/$B$6))
Bing3000600086,96%
Google 25007000121,74%
Twitter2500500086,96%
Total1000023000100,00% (=C6/$C$6/(B6/$B$6))

 

 

Thanks for the advice

Tomas

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: dax divide multiple columns

@tomasmartinek ,

Please refer a screen shot attached:

Capture.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
You can follow me on LinkedIn

Please take a quick glance at newly created report:
My Report

View solution in original post

4 REPLIES 4
Highlighted
Super User IX
Super User IX

Re: dax divide multiple columns

@tomasmartinek , as a new column in the table

[Price (col B)]/sum([Price (col B)])/ [Profit (col C)] /sum( [Profit (col C)])

 

or as a new measure

sum(Table[Price (col B)])/calculate(sum([Price (col B)]),all(Table))/ sum(Table[Profit (col C)]) /calculate(sum(Table[Profit (col C)]),all(Table))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Super User III
Super User III

Re: dax divide multiple columns

@tomasmartinek ,

Please refer a screen shot attached:

Capture.PNG

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
You can follow me on LinkedIn

Please take a quick glance at newly created report:
My Report

View solution in original post

Highlighted
Helper I
Helper I

Re: dax divide multiple columns

@tomasmartinek,

 

1) You should create a calculated measure as it will be dynamic in relation to any axes of analysis you want to apply.

2) You should use the divide () function, best solution to divide numbers without generating errors.

3) If you repeat the sam DAX formula, it is best to use a variable.

 

Example:

Measure =

var DivideNumber = divide(sum('Table (2)'[Column1]),sum('Table (2)'[Column2]))

return

divide(DivideNumber,DivideNumber)

 

Highlighted
Super User IX
Super User IX

Re: dax divide multiple columns

@tomasmartinek - Is that really how your data looks? You can't refer to individual cells in DAX, you have to filter down from rows and columns.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors