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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.