Forum Discussion
Create a Calculated Column from Different Tables
if there is a join between the tables (e.g. 1:1, 1:many) you can reference them with:
RELATED when referring to the 1
RELATEDTABLE when referring to the many
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
- Stachu7 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?- Anonymous7 years agoNot applicable
Hi Stachu,
this formula isn't working either. table 2 is a created table with following data:
The formula used is: Table 2 = FILTER(CALENDAR("01-01-2018",TODAY()),[Date]=EOMONTH([Date],0))
Date 31 January 2018 28 February 2018 31 March 2018 30 April 2018 31 May 2018 30 June 2018 31 July 2018 31 August 2018 30 September 2018 Using the formula you mentioned i am only getting new against the dates where live date is end of month. However what i need is this (the client live date of 26th oct is also a new client for october 2018)
Table 1
Today Live date Client ID Actual status Status required 26-Oct 30-Sep A00034 new new 26-Oct 26-Oct 12303 old new 26-Oct 05-Oct 12302 old new 26-Oct 28-Feb 564735 new new 26-Oct 01-Sep 102538 old new 26-Oct 15-Sep 109928 old new 26-Oct 31-Jul 0928abc new new 26-Oct 26-Oct 1856XY old new - Stachu7 years agoCommunity Champion
based on what you've written I'm not sure whether I get the requirement properly
are the values in the column supposed to chagne depending on the month you select? if that's the case then it's not possible.
you could show the customers which are new for a given month with a measure, but it's a different problemIf the values in the column are static - do you mean to compare them with the real time date? e.g. using TODAY()? if that's the case then there is no need for the additional table