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

Sum of totals

Hi,

 

I have a very simple table containing 3 columns:

- Locatie

- Date

- Waarde (value)

I created a measure:

#waarde = sumX(SUMMARIZE('table 1','table 1'[Locatie], "naam",AVERAGE('table 1'[Waarde])),[naam])
 
I show the data in a Pivot:
Schermafbeelding  .png
 
I'm looking for the average of the orange selection. The average should be 22376 (calculated in Excel) but it shows 23916 (this is correct for the total column, but not for the total row in this case). How can I calculate the value i'm looking for?
 
Thank you.
 
1 ACCEPTED SOLUTION

@jelleschuurman 

Not sure but worth a try

#waarde =
SUMX (
SUMMARIZE (
'table 1',
'table 1'[Locatie],
'table 1'[datum].MONTH,
"naam", AVERAGE ( 'table 1'[Waarde] )
),
[naam]
)

View solution in original post

6 REPLIES 6

@tamerj1 

It sort of works in this model 🙂 I have to divide the total by the amount of months (12 in this case) and then I get the expected result. all the other values are then incorrect, but i don't need them in this case.

 

I tried to do this in a datamodel with a seperate date table, but then I do not get the wanted result. I tink its because of filters. I tried to exclude them with All/Allexpect but I cannot get the right amount.

 

This table 1 is not connected directly to the date table, but it is via another related table.

 

Is sumx with summarize the correct way to calculate this? I also tried the groupby function and get the same results. 

@jelleschuurman 

Please share a screenshot of the data model with the relationships 

Hi @tamerj1 

 

Sorry for the late reply.

I looked at the datamodel and saw that I made a mistake in the model. I changed the model and the formula (without 'table 1'[datum].MONTH,) is working correct.

tamerj1
Super User
Super User

Hi @jelleschuurman 

the month column is from which table?

Hi @tamerj1 ,

 

The same table:

Schermafbeelding  2.png

@jelleschuurman 

Not sure but worth a try

#waarde =
SUMX (
SUMMARIZE (
'table 1',
'table 1'[Locatie],
'table 1'[datum].MONTH,
"naam", AVERAGE ( 'table 1'[Waarde] )
),
[naam]
)

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.

Top Solution Authors