Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong error reported when using EARLIER() with row-context columns like CALENDAR() #9

Closed
zenzeinet opened this issue May 28, 2021 · 1 comment
Milestone

Comments

@zenzeinet
Copy link

zenzeinet commented May 28, 2021

When creating a calculated table with the CALENDAR() function, which creates a [date] column, TE3 marks as non-valid (error) the code that references the [date] column, when it is used together with EARLIER

Error: column [DATE] cannot be found...
Error: the EARLIER function only accepts a column...

Eg:

ADDCOLUMNS(
    CALENDAR(date(2017 , 1 , 1) , date(2022 , 1 , 1) )
    , "EOM" , EOMONTH([Date],0)
    , "BOM" , DATE(year([Date]) , MONTH([Date]) , 1)
    , "año" , year([Date])
    , "MonthInt" , year([Date]) * 100 + month([Date])
    , "Previous date with data in fact table"
    , 
       calculate(
          if(ISBLANK(max(FactTable[DATA_DAY])) , BLANK() , max(FactTable[DATA_DAY]))
          , all(FactTable)
          , FactTable_Dates[fact_Date] < EARLIER([Date])  --<<<<non-existing issue here
          , FactTable_Dates[fact_Date] > (-31 + EARLIER([Date])) --<<<<non-existing issue here
       )  
)
 

P.S.: yes, I know I could use VAR ;-)

EDIT: It also happens in other uses of EARLIER:

sumx(
    values( 'Table'[Column] )
    , CALCULATE(
        sum('Table'[SomeOtherColumn])
        , keepfilters(Table2[Whatever] <= EARLIER([Column]))  --<< non-existing issue here
    )
)	
@zenzeinet zenzeinet changed the title Wrong error reported when using CALENDAR() Wrong error reported when using EARLIER() with row-context columns like CALENDAR() May 31, 2021
@otykier otykier added this to the 3.0.1 milestone May 31, 2021
@otykier
Copy link
Collaborator

otykier commented Jun 1, 2021

Fixed in 3.0.1. Thanks for reporting!

@otykier otykier closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants