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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Pbiuserr
Post Prodigy
Post Prodigy

Count all records above average

Hello,

I've got a column ResTime provided in seconds (should get it only from two statuses). I need to capture all rows being above average of ResTime for these

 

Can someone have a look at that and say if its properly written?

 

My calculation is like down below

 

AboveAVG =
VAR MyAvg = CALCULATE(
AVERAGE('data'[RES_TIME]), ALL('data'[RES_TIME])
)
RETURN
IF(
ISBLANK(
CALCULATE(COUNTROWS('data'), FILTER('data','data'[RES_TIME] > MyAvg))),"N/A"
,CALCULATE(
COUNTROWS('data'),
FILTER('data','data'[RES_TIME] > MyAvg)))

 

 

1 REPLY 1
amitchandak
Super User
Super User

@Pbiuserr , Simply try

AboveAVG =
VAR MyAvg = CALCULATE(
AVERAGE('data'[RES_TIME]), ALL('data'[RES_TIME])
)
return CALCULATE(
COUNTROWS('data'),
FILTER('data','data'[RES_TIME] > MyAvg))

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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