Forum Discussion

powerbi_alvic's avatar
powerbi_alvic
Frequent Visitor
5 years ago
Solved

DAX Measure with Conditional Filters

Hello guys, I need help for this requirement.  Number of tickets rejected that have been passed previously(create_time) by commercial queue. Is it possible to do it with a measure?       ...
  • stevedep's avatar
    stevedep
    5 years ago

    Hi,

     

    This should work for you:

     

    ___CountPassedbyCommercialPrev = 
    var _dateRejected = CALCULATE(MAX('Table'[create_time]),'Table'[state]="rejected")
    return
    
    COUNTROWS (
        FILTER (
            ALL ( 'Table' ),
            'Table'[ticket_id] = SELECTEDVALUE ( 'Table'[ticket_id]) && 'Table'[queue] = "commercial" && 'Table'[create_time] <= _dateRejected )
        )
    
    
    ___CountPerTicket = 
    SUMX(VALUES('Table'[ticket_id]),[___CountPassedbyCommercialPrev])

     

     

    Link to the file here

     

    In this video I explain how to approach and build such a measure. Hope its helpfull.

     

    Kind regards,

     

     

    Steve.