Forum Discussion
luanamoreschi
2 years agoFrequent Visitor
Dynamically rename columns using text manipulation functions and conditional logic
Hello everyone, My database presents sales for each month in this format: SELECT Sales_ActualMonth, SalesLast1Months, SalesLast2Months and so forth. I'm looking for a way to dynamically rename co...
Anonymous
2 years agoNot applicable
Hi luanamoreschi ,
Base on my research, Power BI does not support dynamic column names directly in the data model. You can follow the steps to achieve the similar requirement as an workaround:
1. Create some measures with dynamic titles using a combination of DAX and the selection of visuals that support dynamic titles.
Sales Actual Month = FORMAT( TODAY(), "MMMMYYYY")
SalesLast1Months = FORMAT(EDATE(TODAY(), -1), "MMMMYYYY")
SalesLast2Months = FORMAT(EDATE(TODAY(), -2), "MMMMYYYY")
2. Create a card visual and apply this measure as a title of card visual
Best Regards