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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
GRedhead
Helper I
Helper I

Average of values from a mesure field

Hi,

 

I have created a diff in days field which gives me the number of days from when a record is created to when it was first replied to

 

Diff in Day Measure = DATEDIFF ( SELECTEDVALUE ('incident'[Referral Date]), SELECTEDVALUE ('incident'[Calculated First Date]), DAY )
 
I now want to get the average of this field by record type and have tried the following but it does not appear to be correct, any help is appreciated.
 
Average Diff in Days = AVERAGEX(VALUES('incident'[new_casetype]),[Diff in Day Measure])
1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @GRedhead ,

 

I have created a data sample for test, Please try:

Average Diff in Days =
VAR _t =
    ADDCOLUMNS ( 'incident', "Diff", [Diff in Day Measure] )
RETURN
    AVERAGEX (
        FILTER ( _t, [new_casetype] = MAX ( 'incident'[new_casetype] ) ),
        [Diff]
    )

 Output:

Eyelyn9_0-1653875340335.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.

View solution in original post

1 REPLY 1
v-eqin-msft
Community Support
Community Support

Hi @GRedhead ,

 

I have created a data sample for test, Please try:

Average Diff in Days =
VAR _t =
    ADDCOLUMNS ( 'incident', "Diff", [Diff in Day Measure] )
RETURN
    AVERAGEX (
        FILTER ( _t, [new_casetype] = MAX ( 'incident'[new_casetype] ) ),
        [Diff]
    )

 Output:

Eyelyn9_0-1653875340335.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.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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