The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi community!
Power bi is having problems to create a "Calendar Table" using my code (which in my opinion is correct).
After I provided the code (please check below), I get the next error: "Cannot identify the table that contains [Date] column."
I need the table to create a relation between my other two tables (both tables have multiples records in their respective "Date" columns, and the data type of those columns is "Date".
Do you know what's wrong? As you can see, indeed the table and column to which I'm making reference exists and are correct (I provide an screen shot of my two single tables in the model).
CODE:
Solved! Go to Solution.
Hi @Miguel_Rojo
The problem is in the expressions for "Max Year" and "Max Month".
The MAX function must take a column reference from a physical table as its argument.
Did you want these to be the overall maximum year/month appearing in the Calendar Table?
If so you could write this (since the maximum date is already contained in the variable __End_Date )
"Max Year", YEAR( __End_Date ),
"Max Month", MONTH( __End_Date )
If that's not what you wanted, please post back to clarify what you wanted these values to be.
Regards
Owen
Hi @Miguel_Rojo
The problem is in the expressions for "Max Year" and "Max Month".
The MAX function must take a column reference from a physical table as its argument.
Did you want these to be the overall maximum year/month appearing in the Calendar Table?
If so you could write this (since the maximum date is already contained in the variable __End_Date )
"Max Year", YEAR( __End_Date ),
"Max Month", MONTH( __End_Date )
If that's not what you wanted, please post back to clarify what you wanted these values to be.
Regards
Owen
Thanks Owen!!, you were right!, I was selecting an unexisting table using the MAX() function; I changed the code by: