Forum Discussion

vivica19's avatar
vivica19
Frequent Visitor
2 years ago
Solved

Price Increase/Decrease Flag

Hi,  I am trying to create a flag for price inc/dec where if the latest date is true in the ANY_PRICE_INC column it takes the date of the first Consecutive row.    In this case for example the mos...
  • Greg_Deckler's avatar
    Greg_Deckler
    2 years ago

    vivica19 I feel like I am still missing some critical information, but you could do this potentially:

    Measure = 
        VAR __CurrentDate = MAX( 'Table'[DATE] )
        VAR __MaxDate = MAXX(ALLSELECTED('Table'), [DATE])
        VAR __IsTrue = SELECTCOLUMNS(FILTER( ALLSELECTED( 'Table' ), [ANY_PRICE_INC] = TRUE() && [DATE] = __MaxDate ), "__AnyPriceInc", [ANY_PRICE_INC] )
        VAR __MinDate = MINX( FILTER( ALLSELECTED('Table'), [ANY_PRICE_INC] = TRUE() ), [DATE] )
        VAR __MinDateRate = MAXX( FILTER( ALLSELECTED( 'Table' ), [ANY_PRICE_INC] = TRUE() && [DATE] = __MinDate ), [ASP] )
        VAR __Result = IF( __IsTrue && __CurrentDate = __MinDate, __MinDateRate, BLANK() )
    RETURN
        __Result