Forum Discussion
vivica19
2 years agoFrequent Visitor
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...
- 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
Greg_Deckler
Community Champion
2 years agovivica19 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
vivica19
2 years agoFrequent Visitor
it worked perfectly well...!!! thanks sooooo much 🙂