Forum Discussion
Need help-DAX code
- 1 year ago
Hi Pmrs,
Thanks for reaching out to the Microsoft fabric community forum.
I’ve replicated your scenario in Power BI and achieved the expected result using your logic:identifying agents who made more calls than their target.
I entered sample data with Agent, CallsMade, and TargetCalls columns.
To flag agents exceeding their targets, I added a calculated column:
ExceededFlag = IF('Table'[CallsMade] > 'Table'[TargetCalls], 1, 0)
This returns 1 if CallsMade is greater than TargetCalls.
Next, I created a measure to count the agents who exceeded their targets:
TotalExceededCalls = CALCULATE(COUNTROWS('Table'), 'Table'[CallsMade] > 'Table'[TargetCalls])
Using a table and a card visual in Power BI, I confirmed that 4 agents surpassed their targets, exactly as required.Please find the attached pbix file for your reference.
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Best Regards,
Tejaswi.
Community Support
Hi Pmrs
To create a DAX measure called TotalExceededCalls, the goal is to count or sum the number of calls that exceeded the assigned Target Calls for each context—such as per agent, region, or time period. The logic is to compare the Actual Calls Made against the Target Calls, and identify only those instances where the actual calls are greater than the target.
Assuming you have a table (e.g., CallData) with columns like [CallsMade] and [TargetCalls], you can write a DAX measure like this:
TotalExceededCalls =
CALCULATE(
COUNTROWS('CallData'),
FILTER(
'CallData',
'CallData'[CallsMade] > 'CallData'[TargetCalls]
)
)
This measure filters the table to only those rows where the number of calls made exceeds the target and then counts those rows. If instead you want to sum the exceeded amount, use:
TotalExceededCalls =
CALCULATE(
SUMX(
FILTER('CallData', 'CallData'[CallsMade] > 'CallData'[TargetCalls]),
'CallData'[CallsMade] - 'CallData'[TargetCalls]
)
)
This version returns the total number of extra calls made beyond the target across all relevant rows. The choice between counting records or summing the excess depends on your reporting need. This logic can be visualized across agents, teams, or dates to track performance beyond targets.