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

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

#### Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors