Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi community.
I am creating a Date Table that I do not require to always input the columns but one stack of code. As I was creating it, I had a problem which was referencing other columns in a new column.
It became quite hard to use quoted columns above in the same code.
The pbix with the Date table with the errors is here. Thanks.
Date pbix file
Solved! Go to Solution.
Hi, @Datagulf
I checked your code, and saw you use 'addcoumn' function to create your date table, you should know that the new columns are side by side, so you can’t refer to one column from another.
You have two ways, one is to use addcolumn nested, so that the following columns can refer to the column names in the previous table.
The second is to create a new column in the form of a calculated column.
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Hi, @Datagulf
I checked your code, and saw you use 'addcoumn' function to create your date table, you should know that the new columns are side by side, so you can’t refer to one column from another.
You have two ways, one is to use addcolumn nested, so that the following columns can refer to the column names in the previous table.
The second is to create a new column in the form of a calculated column.
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
@Datagulf , Date is the only column you have available for add columns to use. All your calculation should be based on that.
Not very clear what you want to do there, But have the same var there in other columns and try.
example
"Day",VAR Current_Year = RIGHT(YEAR([Date]),2)
VAR Last_Year = RIGHT(YEAR([Date])-1,2)
VAR Next_Year = RIGHT(YEAR([Date])+1,2)
VAR Fiscal_Year =
IF(
MONTH([Date]) >= 4,
Current_Year & "/" & Next_Year,
Last_Year & "/" & Current_Year
)
RETURN FORMAT ( [Date], CONCATENATE("dd-ddd-mmm ", Fiscal_Year)),
@amitchandak What I am trying was to use already quoted columns to create other columns but I guess from your comment, that is impossible and one can only use the Date Column in reference to creating other columns, right?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |