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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Red_prov
Helper I
Helper I

How to calculate average on card without highest and lowest value

Hello!

 

I have two cards both containing averages.

 

One is the average for response time to an inbound message. While the second card contains the average time to close/end the conversation. 

 

These averages are based on the date range selected by the user. 

 

However i was asked if i could remove the min/max values for each average prior to displaying the results. 

Is this possible?

 

Heres how im calculating the initial response average

 

ConversationInitialResponse = DATEDIFF(MIN(CardAccessMessages[FirstMessageTime]),MAX(CardAccessMessages[ResponderTimeStamp]),MINUTE)
 
- each record can have multiple entries so im grabbing the first time, and the max responder timestamp available.
 
AvgRespDir = AVERAGEX(VALUES(Messages[ConversationID]),Messages[ConversationInitialResponse])  
 
Thanks for any help!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Red_prov , Try like

 

AvgRespDir =
var _max = MaxX(VALUES(Messages[ConversationID]),[ConversationInitialResponse])
var _min = Minx(VALUES(Messages[ConversationID]),[ConversationInitialResponse])
return
AVERAGEX(filter(VALUES(Messages[ConversationID]),[ConversationInitialResponse]<> _max && [ConversationInitialResponse]<> _min ),[ConversationInitialResponse])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Red_prov , Try like

 

AvgRespDir =
var _max = MaxX(VALUES(Messages[ConversationID]),[ConversationInitialResponse])
var _min = Minx(VALUES(Messages[ConversationID]),[ConversationInitialResponse])
return
AVERAGEX(filter(VALUES(Messages[ConversationID]),[ConversationInitialResponse]<> _max && [ConversationInitialResponse]<> _min ),[ConversationInitialResponse])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the assistance @amitchandak!

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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

Users online (508)