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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
kalwabharath44
Frequent Visitor

Aggregate Sum and Do an Average

Hi All,

 

I Have a table containing Project Name, Stage , Start and Finish, Days to Complete ,Department

 

ProjectNameTaskActualStartActualEndDaystoCompleteDepartment
Test 1CMD5/16/2019 5/16/2019 01-Sol
Test 1CMD4/23/2019 4/26/2019 31-Sol
Test 1DM4/29/2019 5/2/2019 32-Por
Test 1DM4/26/2019 5/1/2019 52-Por
Test 1DM5/7/2019 5/10/2019 32-Por
Test 1EF4/2/2019 4/2/2019 33-Test
Test 1FE4/2/2019 4/2/201954-Dep

How can i get an aggregated sum and then do an average as shown below

 

ProjectNameTaskActualStartActualEnddaystoCompleteDepartmentAggregatedSumAverage
Test 1CMD5/16/20195/16/201901-Sol33
Test 1CMD4/23/2019 4/26/2019 31-Sol
Test 1DM4/29/2019 5/2/201932-Por1111
Test 1DM4/26/20195/1/201952-Por
Test 1DM5/7/20195/10/201932-Por
Test 1EF4/2/20194/2/2019 33-Test33
Test 1FE4/2/20194/2/201954-Dep33
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kalwabharath44 , Try two measures like

 

sumx(filter(allselected(Table), Table[ProjectName] = max(Table[ProjectName]) && Table[Task] = max(Table[Task])), [DaystoComplete])


AverageX(summarize(allselected(Table), Table[ProjectName], Table[Task], "_1", sum(Table[DaystoComplete])),[_1])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
kalwabharath44
Frequent Visitor

 Hi Amit,

 

The Measure provided sumx(filter(allselected(Table), Table[ProjectName] = max(Table[ProjectName]) && Table[Task] = max(Table[Task])), [DaystoComplete]) did solve my problem

 

Thankyou for the Help !!!

Anonymous
Not applicable

Try this: 

ProjectSummary1 = SUMMARIZE(Projects, Projects[Department], "Avg Time", AVERAGE(Projects[DaysToCompleteCol]))
 
 
Anonymous
Not applicable

You can create a calculated summarize table summarized on ProjectName, Task and Department.

 

I am not sure what is the logic/granularity for your "Average" column. If it is Average of "Sum" then it should be at a higher granular level.

amitchandak
Super User
Super User

@kalwabharath44 , Try two measures like

 

sumx(filter(allselected(Table), Table[ProjectName] = max(Table[ProjectName]) && Table[Task] = max(Table[Task])), [DaystoComplete])


AverageX(summarize(allselected(Table), Table[ProjectName], Table[Task], "_1", sum(Table[DaystoComplete])),[_1])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.