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

Calculate function across relationships

Hello, I have the following model where I can't get the calculate function to work properly.Capture.PNG

 

I am trying to calculate the sum of the Amount column in the ApplyMBI Payments table. My measure is:

total amount = CALCULATE(SUM('ApplyMBI Payments'[Amount]))

 

Any direction is appreciated.

1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

Hello, you won't need a measure to sum a value in visualizations. When you add a "numeric" column to a visualization it has the possibility to sum, average, min, max, etc.

Let's asume you need to create the measure anyway. The calculate is not necessary you can just SUM('ApplyMBI Payments'[Amount]). Calculate is for hard calculation.

 

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @johnchill,

 

In my opinion, it seems that you want to sum all of the 'ApplyMBI Payments'[Amount], right?

 

You can consider adding ALL() or ALLSELECTED() function inside of the CALCULATE(). See:

 

total amount = CALCULATE(SUM('ApplyMBI Payments'[Amount]), ALL('ApplyMBI Payments'))

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
scottsen
Memorable Member
Memorable Member

You will have to clarify what is not working.

 

While the CALCULATE isn't needed, it shouldn't really hurt you either.

total amount = SUM('ApplyMBI Payments'[Amount])

 

That is totally correct...

 

ibarrau
Super User
Super User

Hello, you won't need a measure to sum a value in visualizations. When you add a "numeric" column to a visualization it has the possibility to sum, average, min, max, etc.

Let's asume you need to create the measure anyway. The calculate is not necessary you can just SUM('ApplyMBI Payments'[Amount]). Calculate is for hard calculation.

 

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!