Forum Discussion
Anonymous
7 years agoNot applicable
Create a Calculated Column from Different Tables
Hi, I have data as in the table below: I need period end dates (month end dates from jan to dec 2018). I was able to create a new table with the required dates. However for my further calculatio...
Anonymous
7 years agoNot applicable
Hi Stachu,
I'll rephrase my statement.
I need to match year and month of live date and period end date. I am using the following formula (using related function) but it is not populating any data.
Column = IF(AND(YEAR(Table[LiveDate]) = YEAR(RELATED('Table2'[PeriodEndDate]), MONTH(Table[LiveDate]) = MONTH(RELATED('Table2'[PeriodEndDate], "New")
Can't find the error
Stachu
7 years agoCommunity Champion
you're missing few closing brackets and false value for IF, this should work
Column =
IF (
AND (
YEAR ( Table[LiveDate] ) = YEAR ( RELATED ( 'Table2'[PeriodEndDate] ) ),
MONTH ( Table[LiveDate] ) = MONTH ( RELATED ( 'Table2'[PeriodEndDate] ) )
),
"New",
"Old"
)if the code above doesn't work:
1) are both Table[LiveDate] and Table2[PeriodEndDate] of type date?
2) is there a relationship between the 2 tables?
3) can you share the sample of Table2 data?