Forum Discussion
Anonymous
6 years agoNot applicable
Lookup? IF?
Hi All, i need help to find a right formula. I do have 3 colum: Date ( dates ) - Origin ( Text ) - Destination ( Text ). The goal here is to find old and new lanes. i am trying to look a...
- 6 years ago
Hi Anonymous ,
We can create a measure as below.
Measure = VAR countr = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', YEAR ( 'Table'[date] ) = 2018 ) ) RETURN IF ( ISBLANK ( countr ), "new lane", "old lane" )Or we can crreate a calculated column to work on it.
Column = VAR countr = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[origin], 'Table'[destination] ), YEAR ( 'Table'[date] ) = 2018 ) ) RETURN IF ( countr = BLANK (), "new lane", "old lane" )
v-frfei-msft
6 years agoCommunity Support
Hi Anonymous ,
We can create a measure as below.
Measure =
VAR countr =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( 'Table', YEAR ( 'Table'[date] ) = 2018 )
)
RETURN
IF ( ISBLANK ( countr ), "new lane", "old lane" )
Or we can crreate a calculated column to work on it.
Column =
VAR countr =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[origin], 'Table'[destination] ),
YEAR ( 'Table'[date] ) = 2018
)
)
RETURN
IF ( countr = BLANK (), "new lane", "old lane" )