Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
water-guy-5
Helper III
Helper III

Calculating a sum of multiple locations

Hello,

I asked a question yesterday and have a little more information to provide!

So, my goal is to calculate the total reading/output of a specific city and compare it to what is required by law. I take the last 90 days of readings to calculate this.

Here's what I want: the average readings by specific equipment, and then the total of the averages (picture attached)

waterguy5_0-1654872694499.png

Right now, I have a measure that calculates the # of readings in the last 90 days, the sum of the readings, and it divides to find the total average.

Measure = 

Var AmountRecorded = SUM(Table[Value]) ---> This is just a column that has the readings
Var Readings = Table[NumOfReadings] ---> This is measure saying countrows that are greater than 0 and not blank
Var MaxDate = MAX(Table[Date])
Return
CALCULATE(
DIVIDE(AmountRecorded,Readings),
DATESBETWEEN(Table[Date], MaxDate, MaxDate - 90))


The measure above is essentially performing this...

waterguy5_1-1654872990829.png

 

It combines all the values and calculates a total average. Instead, I would want a measure that adds 250, 350, and 324 to give me a total "average" of 924.

Please let me know if I need to add any other info for help.

Thanks!



 








1 ACCEPTED SOLUTION
nvprasad
Solution Sage
Solution Sage

Hi,

 

The below formula should work for your requirment.

 

Result = SUMX(SUMMARIZE ( 'Table', 'Table'[Equipment] ),CALCULATE( AVERAGE('Table'[Reading])))
 
Also result should be 250 + 250 + 291 = 891 ( instead of 924)
 
Thank You,
 
Regards,
N  V Durga Prasad

View solution in original post

1 REPLY 1
nvprasad
Solution Sage
Solution Sage

Hi,

 

The below formula should work for your requirment.

 

Result = SUMX(SUMMARIZE ( 'Table', 'Table'[Equipment] ),CALCULATE( AVERAGE('Table'[Reading])))
 
Also result should be 250 + 250 + 291 = 891 ( instead of 924)
 
Thank You,
 
Regards,
N  V Durga Prasad

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.