Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
luanamoreschi
Frequent 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 columns in Power BI. For example, Sales Actual Month would be displayed as December2023, Last1Months would become November2023, and similarly for the others. And as the month changes, the names should update automatically without the need for manual renaming.

Is it possible to achieve this using M, DAX, or even SQL?

Thank you.

1 REPLY 1
Anonymous
Not 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 

vyiruanmsft_2-1703234865650.pngvyiruanmsft_0-1703234776519.png

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.