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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
timwilson
Frequent Visitor

DAX Help, store value in variable unfiltered but filtered by slicer

Hi,

 

I'm trying to recreate a contact centre view, I require staff required and staff on phone by interval.

 

Calls that have been answered attract handling time, and when I try and store that as a variable and multiply that by all calls (not just answered), it only will multiply it by the calls answered, I assume that's because it's matching rows for the handling time measure.

 

How do I store the handling time measure in a variable that can be used regardless if there is a matching row for the call counts?

 

The workload (FTE) measure should return a different result than Onphone(FTE). 

Workbook : https://drive.google.com/open?id=0B7_6Zpn28a-LTUk1VmxwYXBLajA

 

1 ACCEPTED SOLUTION

@timwilson

 

You input incorrect AHT expression in Workload(FTE) measure.

 

Your measue is:

 

WorkLoad(FTE) =
VAR AHT =
    DIVIDE (
        (
            SUM ( Query1[ActiveDuration] ) + SUM ( Query1[HoldDuration] )
                + SUM ( Query1[ConsultDuration] )
                + SUM ( Query1[ConfDuration] )
                + SUM ( Query1[WrapDuration] )
        )
            / 1000,
        SUM ( Query1[InboundQueuedCount] ),
        0
    )
VAR QueueCalls =
    SUM ( Query1[InboundQueuedCount] )
RETURN
    DIVIDE ( ( QueueCalls * AHT ), 900, 0 )

 

But your AHT measure is:

 

AHT =
DIVIDE (
    (
        SUM ( Query1[ActiveDuration] ) + SUM ( Query1[HoldDuration] )
            + SUM ( Query1[ConsultDuration] )
            + SUM ( Query1[ConfDuration] )
            + SUM ( Query1[WrapDuration] )
    )
        / 1000,
    CALCULATE ( SUM ( Query1[InboundQueuedCount] ), Query1[CallActionId] = 8 ),
    0
)

Just replace AHT variable with correct formula, it can return correct result.

 

 

0.PNG

 

Regards,

View solution in original post

4 REPLIES 4
vanessafvg
Super User
Super User

is it always the same amount?  ive looked at your model but can you direct me to the exact measure you are trying to accomplish this?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




No the problem is that it's showing as the same amount in the model.

 

The calculation is ((calls*handletime)/intervallengthseconds (900) in this case).

 

It should look like this:

 

Where wkload for 8:30 interval is (32*544.6)/900

 

IntervalInboundQueuedCountAHTWkLoadOnPhone
3/05/2017 8:3032544.619.410.9
3/05/2017 8:4517620.211.76.2
3/05/2017 9:0025641.917.83.6
3/05/2017 9:1535509.419.89.1
3/05/2017 9:3023440.911.34.9
3/05/2017 9:4519553.711.76.8

 

In the model I get the lower figure which leads me to believe it's only calculating rows where the AHT measure components are populated, if blank it seems to ignore the calls.

@timwilson

 

You input incorrect AHT expression in Workload(FTE) measure.

 

Your measue is:

 

WorkLoad(FTE) =
VAR AHT =
    DIVIDE (
        (
            SUM ( Query1[ActiveDuration] ) + SUM ( Query1[HoldDuration] )
                + SUM ( Query1[ConsultDuration] )
                + SUM ( Query1[ConfDuration] )
                + SUM ( Query1[WrapDuration] )
        )
            / 1000,
        SUM ( Query1[InboundQueuedCount] ),
        0
    )
VAR QueueCalls =
    SUM ( Query1[InboundQueuedCount] )
RETURN
    DIVIDE ( ( QueueCalls * AHT ), 900, 0 )

 

But your AHT measure is:

 

AHT =
DIVIDE (
    (
        SUM ( Query1[ActiveDuration] ) + SUM ( Query1[HoldDuration] )
            + SUM ( Query1[ConsultDuration] )
            + SUM ( Query1[ConfDuration] )
            + SUM ( Query1[WrapDuration] )
    )
        / 1000,
    CALCULATE ( SUM ( Query1[InboundQueuedCount] ), Query1[CallActionId] = 8 ),
    0
)

Just replace AHT variable with correct formula, it can return correct result.

 

 

0.PNG

 

Regards,

Oh wow, that is really silly of me.

 

Thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.