cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Calculate sum of difference

Hi, Gurus!

I have a task where two tables.

The first table without date field, second with. They are joined by the field "Group", it is the first field from my screenshot.

I need to calculate the sum of the difference between the two measures.

Measure from the first table i calculate as Measure1 = SUM('Table1'.[Field1])

The second measure from table 2 i calculate as Measure2 = AVERAGE('Table2'.[Filed2])

The problem is I can't get the correct total of difference between fields, but in rows all is correct.

I already tried SUMX, AVERAGEX. Tried to store the result of values on VAR, but it doesn't help

1 ACCEPTED SOLUTION
Super User

@Anonymous try this measure:

``````New Measure =
SUMX ( VALUES ( Table[Lpyma Column] ), [Measure] - [Measure2] )``````

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

2 REPLIES 2
Super User

@Anonymous try this measure:

``````New Measure =
SUMX ( VALUES ( Table[Lpyma Column] ), [Measure] - [Measure2] )``````

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Thanks a lot! It works great

Announcements

#### Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

#### Power BI March 2023 Update

Find out more about the March 2023 update.

#### March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors
Top Kudoed Authors