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

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

Reply
Anonymous
Not applicable

Adding in a Condition that deals with quotes that feature a recall.

Hi everyone, 
 
I'm in need of some help... 
 
I'm trying to edit my DAX Measure seen below to add in a condition that would deal with quotes that feature a recall in its history. 
 
Currently, the Measure takes the submission date from the final line of the history, and subtracts that by the response date. 
 
Essentially, the condition would be able to detect if a quote has a recall in its history and would take the response date from the recalled line and take the place of the submission date in the final line subtraction. 
 
I have a screenshot attached below to hopefully provide a good visual example of what I would be looking to do. 
 
Antma56_0-1691178102667.png

Below is the DAX Measure that I'd be looking to put the condition into:

 
Quote Turnaround Time for Approval Report Test File =
VAR ResponsesThisQuoteVersion =
    CALCULATETABLE (
        DISTINCT ( 'Test Approval Report'[Response Date] ),
        ALLEXCEPT ( 'Test Approval Report', 'Test Approval Report'[Quote Number], 'Test Approval Report'[Quote Version] )
    )
var ThisResponse = AVERAGEX('Test Approval Report','Test Approval Report'[Response Date])
var SubDT = AVERAGEX('Test Approval Report','Test Approval Report'[Submission Date ])
VAR MaxResponse =
    MAXX( ResponsesThisQuoteVersion, 'Test Approval Report'[Response Date] )
RETURN

    IF (
        ThisResponse <> MaxResponse,
        BLANK(),
        MaxResponse - SubDT
    ) *24 * 60
 
For what it's worth, I was also able to create calculated columns that would retrieve the previous row's value. Not sure if that's a relevant detail to provide or not. 
 
For whomever takes the time to read this and is able to provide suggestions/help, thank you!
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Quote Turnaround Time for Approval Report Test File =
VAR ResponsesThisQuoteVersion =
    CALCULATETABLE (
        DISTINCT ( 'Test Approval Report'[Response Date] ),
        ALLEXCEPT (
            'Test Approval Report',
            'Test Approval Report'[Quote Number],
            'Test Approval Report'[Quote Version]
        )
    )
VAR MaxRecall =
    CALCULATE (
        MAX ( 'Test Approval Report'[Response Date] ),
        ALLEXCEPT (
            'Test Approval Report',
            'Test Approval Report'[Quote Number],
            'Test Approval Report'[Quote Version]
        ),
        'Test Approval Report'[Response] = "RECALLED"
    )
VAR ThisResponse =
    AVERAGEX ( 'Test Approval Report', 'Test Approval Report'[Response Date] )
VAR SubDT =
    AVERAGEX ( 'Test Approval Report', 'Test Approval Report'[Submission Date ] )
VAR MaxResponse =
    MAXX ( ResponsesThisQuoteVersion, 'Test Approval Report'[Response Date] )
RETURN
    IF (
        ThisResponse <> MaxResponse,
        BLANK (),
        MaxResponse - COALESCE ( MaxRecall, SubDT )
    ) * 24 * 60

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Am currently testing this out, and it is working. Thank you so much! 

johnt75
Super User
Super User

Try

Quote Turnaround Time for Approval Report Test File =
VAR ResponsesThisQuoteVersion =
    CALCULATETABLE (
        DISTINCT ( 'Test Approval Report'[Response Date] ),
        ALLEXCEPT (
            'Test Approval Report',
            'Test Approval Report'[Quote Number],
            'Test Approval Report'[Quote Version]
        )
    )
VAR MaxRecall =
    CALCULATE (
        MAX ( 'Test Approval Report'[Response Date] ),
        ALLEXCEPT (
            'Test Approval Report',
            'Test Approval Report'[Quote Number],
            'Test Approval Report'[Quote Version]
        ),
        'Test Approval Report'[Response] = "RECALLED"
    )
VAR ThisResponse =
    AVERAGEX ( 'Test Approval Report', 'Test Approval Report'[Response Date] )
VAR SubDT =
    AVERAGEX ( 'Test Approval Report', 'Test Approval Report'[Submission Date ] )
VAR MaxResponse =
    MAXX ( ResponsesThisQuoteVersion, 'Test Approval Report'[Response Date] )
RETURN
    IF (
        ThisResponse <> MaxResponse,
        BLANK (),
        MaxResponse - COALESCE ( MaxRecall, SubDT )
    ) * 24 * 60

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.