Forum Discussion
dates as column names
- 10 years ago
Hi bhill024. I can't pull from SQL Server right now to confirm, but I don't think the column names will change at all. This is the case if I create a table in Excel, import it, and then go back to the Excel file and change a column header. The table in Power BI retains the original column name.
The good news is your calculations won't break, but of course your column headings will be misleading. Is there a requirement to dynamically name the columns? If not, a simple workaround would be to alias the columns as something like CurrentPeriod, CurrentPeriod-1, CurrentPeriod-2, CurrentPeriod-3. If you want to make it more obvious what the corresponding dates are in your report, you could pull the dynamic headings into a separate table as row values, and display them on the report.
- 10 years ago
The columns name should be able to change after you change the quarter in your data source. Then if your calculations reference these columns by name, they will not work anymore.
Based on my testing, the column position will also change after we click Refresh in Power BI Desktop as below. So the workaround provide by KGrice should be a good choice.
Best Regards,
Herbert
Hi bhill024. I can't pull from SQL Server right now to confirm, but I don't think the column names will change at all. This is the case if I create a table in Excel, import it, and then go back to the Excel file and change a column header. The table in Power BI retains the original column name.
The good news is your calculations won't break, but of course your column headings will be misleading. Is there a requirement to dynamically name the columns? If not, a simple workaround would be to alias the columns as something like CurrentPeriod, CurrentPeriod-1, CurrentPeriod-2, CurrentPeriod-3. If you want to make it more obvious what the corresponding dates are in your report, you could pull the dynamic headings into a separate table as row values, and display them on the report.
- Heman2579 years agoNew Member
" If not, a simple workaround would be ... "
... but if yes? I want to change column name in data source and I want to reproduce this name to column name.
The point is to display names for columns independent on headers on data sets.
Table header:
Column1,Column2,Column3
Something like Column1=Year
If i pick Column1 for filtr, filtr displays "Column" name, but i want to display "Year".
Thanks for reply
HAS