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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
avotius
Frequent Visitor

Card with average count excluding 1's

Hello, my dataset is customer service data with a date, thread id, subject, and message. Every time there is a message a new row is populated, and if it was part of an ongoing message the thread id is the same.

 

What I am trying to do is make a card that will count the amount of messages in a thread, then give me an average of all threads, but exclude any thread where the count is 1 as that would be a new thread that has not been touched. 

 

I made a quick measure and this is what it gave me, but I can't use the filter on the visual for "show items when value..." as the drop down does not work and the input box is greyed out. Any ideas? Thanks!

 

Average ThreadId =
AVERAGEX(
    KEEPFILTERS(VALUES('CareConvos'[ThreadId])),
    CALCULATE(COUNTA('CareConvos'[ThreadId]))
)
1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

I would try a measure like this one.

 

Avg Messages Per Thread =
VAR summary =
    SUMMARIZE (
        'CareConvos',
        'CareConvos'[ThreadId],
        "cCount"COUNT ( 'CareConvos'[ThreadId] )
    )
RETURN
    AVERAGEX ( FILTER ( summary, [cCount] > 1 ), [cCount] )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
avotius
Frequent Visitor

Thanks a million Pat! That actually worked perfectly. Now I am going to pick it apart and try to figure out why it works!

mahoneypat
Employee
Employee

I would try a measure like this one.

 

Avg Messages Per Thread =
VAR summary =
    SUMMARIZE (
        'CareConvos',
        'CareConvos'[ThreadId],
        "cCount"COUNT ( 'CareConvos'[ThreadId] )
    )
RETURN
    AVERAGEX ( FILTER ( summary, [cCount] > 1 ), [cCount] )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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