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
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])

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

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])

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

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!

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.