Forum Discussion
jadewind
Advocate I
9 years agoPower BI cannot apply operator & to numbers?
I was following this article but when it comes to this part adding a new column: "YearQuarter = IF([Quarter] = 1,[Year]-1 & "4",[Year] & [Quarter]-1)" I get errors: "Expression.Error: The name 'IF' w...
jadewind
Advocate I
9 years agoI just realized that I tried to add the formula in Query Editor while I guess I should have added them in the Data tables. They now work. But I just wonder how I can do it in Query Editor?
v-ljerr-msft
Microsoft Employee
9 years agoBut I just wonder how I can do it in Query Editor?
You can follow steps below to add this new column in Query Editor.
1. In Query Editor, Add Column tab, click Add Custom Column to add a custom column.
2. Then enter the column name and use the formula below to create the column.
if [Quarter] = 1 then Number.ToText([Year]-1) & "4" else Number.ToText([Year]) & Number.ToText([Quarter]-1)
Following is the result.
Regards