Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago

Lookup measure

Hi

 

New table

 

Priority level  duration

ciritical           24 hours

high               2 days

moderate      3 days

low               4 days

 

based on this table , how to create a lookup measure with start date, end date & priority level and set whether it is time out or in

How to find it?

 

advance thanks

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I'd modify this slightly.  Your Duration column should be a column of type number, probably in Days.

     

    Next, since your criticality is effectively your primary key, thats how we will do our lookups.

     

    Create a calculated column with your source data, and we will use a lookup to bring across the numerical duration.

    The formula we would use would be something like:

    Duration Limit = LOOKUPVALUE('New Table'[DurationNumber], 'New Table'[Priority Level], [Priority Level])

    Where 'New Table' is the table you put into your post
    [Priority Level] is assumed to be named the same in both tables.

    Now that your data rows have your Start Date, End Date, and the Duration Limit, its now possible to create a calculated column that does the data math (End minus Start) and compares it to the duration limit.  The result is a True/False if it was done in time or not.  This might look like:

     

    On Time = IF(
    	DATEDIFF([Start Date], [End Date], DAY) <= [Duration Limit],
    	TRUE(),
    	FALSE()
    )
  • v-huizhn-msft's avatar
    v-huizhn-msft
    Microsoft Employee

    Hi Anonymous,

    Have you resolved your issue? If you have, please mark the right reply as answer, so more people will benefit from here.

    Best Regards,
    Angelia