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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Samhunt
Helper II
Helper II

Help with formula

Hi guys, 

 

I used the following formula,

 

Average lead Time =
CALCULATE(
    AVERAGE(Bookings[Booking Lead Time]),
    Bookings[Status] = "Paid" || Bookings[Status] = "Confirmed"
)
 
So what I want is the average Booking lead time for all bookings that have paid or confirmed status. When I check my numbers I get minor differences in the results from what I should get. I dont care if the status is different, I want one number that will include both statuses. So I am not sure if the formula is correct or if there is a problem somewhere else. 
 
Regards
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Samhunt ,

 

Please try code as below to create a measure.

Average lead Time =
VAR _STATUSLIST =
    CALCULATETABLE (
        VALUES ( Bookings[Status] ),
        ALLEXCEPT ( Bookings, Bookings[ID] )
    )
RETURN
    CALCULATE (
        AVERAGE ( Bookings[Booking Lead Time] ),
        FILTER ( Bookings, "Paid" IN _STATUSLIST && "Confirmed" IN _STATUSLIST )
    )


Best Regards,
Rico Zhou

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @Samhunt ,

 

Please try code as below to create a measure.

Average lead Time =
VAR _STATUSLIST =
    CALCULATETABLE (
        VALUES ( Bookings[Status] ),
        ALLEXCEPT ( Bookings, Bookings[ID] )
    )
RETURN
    CALCULATE (
        AVERAGE ( Bookings[Booking Lead Time] ),
        FILTER ( Bookings, "Paid" IN _STATUSLIST && "Confirmed" IN _STATUSLIST )
    )


Best Regards,
Rico Zhou

 

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

 

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!

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.