Forum Discussion

tecumseh's avatar
tecumseh
Resolver III
3 years ago

AddColumns The Value For The Field Be Determined

Hi all,

I set AddColumns to add a new column to a table -- that worked fine (Up to T30 below)
But when I try to reference the column to calculate the Leap Year or not, I receive an error message:
The value for LastAppearanceQuarter cannot be determined.
Why is that?

Try_2 = 

VAR T10 = ADDCOLUMNS(VALUES(Bookings[Advertiser]), "FirstAppearance", CALCULATE(MIN(Bookings[Date]), ALLEXCEPT(Bookings,Bookings[Advertiser],Bookings[Channel]), Bookings[Net Revenue] > 0))

VAR T20 = ADDCOLUMNS(T10, "FirstAppearanceQuarter", DATE(YEAR([FirstAppearance]),ROUNDUP( DIVIDE( MONTH( [FirstAppearance] ),3 ),0 ) *3 -2, 1))

VAR T30 = ADDCOLUMNS(T20, "LastAppearanceQuarter", DATE(YEAR([FirstAppearanceQuarter]), MONTH([FirstAppearanceQuarter]) + 9, 1))

VAR LeapYear = MOD(YEAR([LastAppearanceQuarter]),4)

VAR T40 = ADDCOLUMNS(T30,"Leap Year",LeapYear)

Return T40

1 Reply