cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Calculation based on values from different rows and columns

Hi

I have a list of Jobs, that each consists of a list of JobTasks.
Now I want to do calculations on values from 2 different Job_Task_No (6999 & 7499), with values placed in different columns.

(profit %, difference etc.)
I just can't get my head around this ..... 😥

Suggestions? 

Thanks in advance!!

 

JobCalc.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Calculation based on values from different rows and columns

Hi,

 

Please try this measure:

Measure = 
var a = CALCULATE(MAX('Table'[Usage_Total-Cost]),FILTER('Table','Table'[Job_Task_No]=6999))
var b = CALCULATE(MAX('Table'[Contract_Total_Price]),FILTER('Table','Table'[Job_Task_No]=7499))
return
a+b

The result shows the sum of two columns values where Job_Task-No is 6999 and 7499:

12.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

2 REPLIES 2
Highlighted
Super User IV
Super User IV

Re: Calculation based on values from different rows and columns

Not quite sure. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


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

Putting square pegs in round holes since 1972.

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!




Highlighted
Community Support
Community Support

Re: Calculation based on values from different rows and columns

Hi,

 

Please try this measure:

Measure = 
var a = CALCULATE(MAX('Table'[Usage_Total-Cost]),FILTER('Table','Table'[Job_Task_No]=6999))
var b = CALCULATE(MAX('Table'[Contract_Total_Price]),FILTER('Table','Table'[Job_Task_No]=7499))
return
a+b

The result shows the sum of two columns values where Job_Task-No is 6999 and 7499:

12.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto Zhi

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors