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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Count of Items where time is over the average

Hi All, 

 

I've tried searching for this, and for the life of me can't find it, so im hoping someone can help.

 

I have 3 projects, all with varying durations.  I need to be able to calculate the number of projects where the duration is OVER the average of all projects.

 

Example:

Project TitleDuration (Hours)

Sample Project 1

.01
Sample Project 2.02
Sample Project 31.5

 

The Average duration for the 3 projects is 0.51 hours.   

 

The desired outcome here is a meausre that shows 1.  1 project has a duration that is over the average.  

 

any help here would be amazing.. ive been struggling mightly to make this work.


Thank you!

1 ACCEPTED SOLUTION

Hi,

Write these measures

Total = sum(Data[Duration (Hours)])

Average = average(Data[Duration (Hours)])

Measure1 = countrows(filter(values(Data[Project title]),[total]>calculate([average],all(Data[Project title]))))

Drag measure1 to the card visual.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

Please use the following formula to create measures:

Flag =
VAR _SumOfEachProject =
    CALCULATE (
        SUM ( 'Table'[Duration (Hours)] ),
        ALLEXCEPT ( 'Table', 'Table'[Project Title] )
    )
VAR _avg =
    AVERAGEX ( ALL ( 'Table' ), [Duration (Hours)] )
RETURN
    IF ( _SumOfEachProject > _avg, 1 )
DistinctCount =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Project Title] ),
    FILTER ( 'Table', [Flag] = 1 )
)

The final output is shown below:

count distinct project.PNG

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

Ashish_Mathur
Super User
Super User

Hi,

How will one differentiate between the 3 projects when all have the same name.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

My apologies. They were supposed to be 1,2&3. Too much of a rush. 

I have  adjusted the original post to as it should be 

Hi,

Write these measures

Total = sum(Data[Duration (Hours)])

Average = average(Data[Duration (Hours)])

Measure1 = countrows(filter(values(Data[Project title]),[total]>calculate([average],all(Data[Project title]))))

Drag measure1 to the card visual.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

This worked perfectly, thank you!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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