Forum Discussion

jakaihammuda's avatar
jakaihammuda
Helper III
2 years ago
Solved

DAX logic based on refresh failures or inprogress

Hello,

I have a basic 3 column table. However the logic i want to implement i cant quite figure out.

 

Essentially all i want to do is the following:
If the [statusname] of a report is either Failed or InProgress for the latest loadstarttimestamp, then i want to take the most recent loadstarttimestamp where the [statusname] was Successful, else just keep the normal latest loadstarttimestamp if the report was successful on the latest load.

I have renamed the columns but here are their true namings:
Report = 'Table 1'[EntityName]
Refreshed = 'Table 1'[StatusName]
Data up To = 'Table 1'[LoadStartTimestamp] - this takes the "latest" so will change whenevr another report refresh occurs,

 

  • Dangar332's avatar
    Dangar332
    2 years ago

    Hi, jakaihammuda 

    try below

    latest status = 
    var a = MAXX(all('status'[Load Start Timestamp]),'status'[Load Start Timestamp])
    VAR b = MINX(FILTER(ALL('status'),'status'[Entity Name]=MAX('status'[Entity Name]) && 'status'[Load Start Timestamp]=a),
               'status'[Status Name]
            )
    var c = MAXX(FILTER(ALL('status'),'status'[Status Name]="succeeded" && 'status'[Entity Name]=MAX('status'[Entity Name])),
              'status'[Load Start Timestamp])
    var d = IF(b<>"succeeded",c)
    RETURN
    d

     

     

     

19 Replies