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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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