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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Peavey
Helper III
Helper III

Calculate based on other columns

Hello,

 

I have this similar dataset: 

IdTask     Progress     Id Main task
1Main task 1     ? 
2Sub task 1     55     1
3Sub task 2     20     1
4Main task 2     ? 
5Sub task 1     10     4
6Sub task 2     0     4
7Sub task 3     95     4
8Main task 3     ? 
9Sub task 1     50     8

 

Intention is to find the average progress based on the sub tasks in each main task. 

My start is: IF(Id main task = BLANK(), ???    Then I need to select all rows with id main task = Id and average these. 

 

How to?

 

Thanks

1 ACCEPTED SOLUTION
vojtechsima
Super User
Super User

Hello, @Peavey 
Try something like this:

vojtechsima_0-1736204057252.png

Average progress = 
var currentId = SELECTEDVALUE('Table'[Id])
var averageSubtasks = AVERAGEX(FILTER(ALL('Table'), 'Table'[     Id Main task] = currentId), 'Table'[     Progress])

return averageSubtasks

View solution in original post

5 REPLIES 5
Peavey
Helper III
Helper III

Thanks for all the help, I found @vojtechsima solution to fit my needs very well!

This community is so impressive, so much knowledge and helpful people here, many thanks again!

 

-A-

@Peavey  Happy to help, kudos appreciated. Thank you too

Anonymous
Not applicable

Hi @Peavey ,

 

You can try formula like below to create calculate column and measure:

SubTaskProgress = IF(NOT(ISBLANK([Id Main task])), [Progress], BLANK())

vkongfanfmsft_0-1736214849048.png

AverageProgress = 
CALCULATE(
    AVERAGE([SubTaskProgress]),
    ALLEXCEPT(TableName, TableName[Id Main task])
)

vkongfanfmsft_1-1736214880646.png

 

Best Regards,
Adamk Kong

 

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

 

ryan_mayu
Super User
Super User

what's the expected output based on the sample data you provided?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




vojtechsima
Super User
Super User

Hello, @Peavey 
Try something like this:

vojtechsima_0-1736204057252.png

Average progress = 
var currentId = SELECTEDVALUE('Table'[Id])
var averageSubtasks = AVERAGEX(FILTER(ALL('Table'), 'Table'[     Id Main task] = currentId), 'Table'[     Progress])

return averageSubtasks

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors