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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Help to calculate the Count of a measure result

I have a table capturing all interactions an operator has every day, we use it to calculate performance and recently they added a couple of columns that help me identify if the customer has contacted us, I use a filter to get the % of interactions where the customer had a follow-up interaction meeting certain conditions:

 

Follow Up = DIVIDE( CALCULATE( SUM(Conversations), Condition 1 = "Yes" && Condition 2 = "Yes") , SUM(Conversations))

 

This gives me the percentage of Conversations meeting certain conditions, and I use it to calculate the Agent and Supervisor Performance in a table somehow like this:

 

AgentSupervisorInteractionsFollow Up
Agent 1Supervisor 186212.99%
Agent 2Supervisor 18419.51%
Agent 3Supervisor 183015.90%
Agent 4Supervisor 279322.95%
Agent 5Supervisor 278115.75%
Agent 6Supervisor 277417.18%
Agent 7Supervisor 376817.84%
Agent 8Supervisor 3755

22.25%

Agent 9

Supervisor 374122.81%

 

There are around 3k agents, I was asked to get the count of agents in different follow-up buckets, the result they are looking for is something like:

 

BucketAgent Count
0.00%-10.00%1356
10.01% - 20.00%1254
20.01% - 30.00%534
30.01% - 40.00%123
40%+5

 

I was trying to get a distinct count of the agent name using the Follow Up measure as Filter but is not working, is it possible and if it is, any ideas?
Here is a sample of the data in OneDrive: OneDrive Link with Sample 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Here's my solution.

1.Create a table by entering data.

vstephenmsft_0-1648705611838.png

2.Create a measure.

Agent Count = 
VAR _table =
    ADDCOLUMNS ( VALUES ( 'Data Sample'[Agent Name] ), "Followup", [FollowUp%] )
RETURN
    SWITCH (
        MAX ( 'Table'[Bucket] ),
        "0.00%-10.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] > 0 && [FollowUp%] <= 0.1 ) ),
        "10.01% - 20.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] > 0.1 && [FollowUp%] <= 0.2 ) ),
        "20.01% - 30.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] > 0.2 && [FollowUp%] <= 0.3 ) ),
        "30.01% - 40.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] > 0.3 && [FollowUp%] <= 0.4 ) ),
        "40%+", COUNTROWS ( FILTER ( _table, [FollowUp%] >= 0.4 ) )
    )

 

Result:

vstephenmsft_1-1648705648763.png

 

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Here's my solution.

1.Create a table by entering data.

vstephenmsft_0-1648705611838.png

2.Create a measure.

Agent Count = 
VAR _table =
    ADDCOLUMNS ( VALUES ( 'Data Sample'[Agent Name] ), "Followup", [FollowUp%] )
RETURN
    SWITCH (
        MAX ( 'Table'[Bucket] ),
        "0.00%-10.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] > 0 && [FollowUp%] <= 0.1 ) ),
        "10.01% - 20.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] > 0.1 && [FollowUp%] <= 0.2 ) ),
        "20.01% - 30.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] > 0.2 && [FollowUp%] <= 0.3 ) ),
        "30.01% - 40.00%",
            COUNTROWS ( FILTER ( _table, [FollowUp%] > 0.3 && [FollowUp%] <= 0.4 ) ),
        "40%+", COUNTROWS ( FILTER ( _table, [FollowUp%] >= 0.4 ) )
    )

 

Result:

vstephenmsft_1-1648705648763.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

johnt75
Super User
Super User

20.00% - 30.00% = 
var summaryTable = ADDCOLUMNS( VALUES('Data Sample'[Agent Name]), "@pct", [FollowUp%])
return COUNTROWS( FILTER( summaryTable, [@pct] > 0.2 && [@pct] <= 0.3))

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.