web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Column name change dyn...
Power Automate
Answered

Column name change dynamically on monthly bases

(0) ShareShare
ReportReport
Posted on by 14

Hello ,

is there any way to make a flow which dynamically changes column name. For example 

current column names are as below

col A : 01-01-2023

col B : 01-02-2023

col C : 01-03-2023

col D : 01-04-2023

 i want to chemge them dynamically from next month it will create as below

col A : 01-02-2023

col B : 01-03-2023

col C : 01-04-2023

col D : 01-05-2023

 

and also clear the values in new column which is col D.


Can anyone help me?

I have the same question (0)
  • lbendlin Profile Picture
    8,726 Super User 2026 Season 1 on at

    Unpivot your data so your columns become rows. That way you always have the same column structure.

  • VJR Profile Picture
    7,635 on at

    You can make use of the Excel formulas for this, either write the formulas manually within the Excel (easy way) or write it via PAD (not needed).

     

    - The first cell will have today's date formula. If you don't want to show this, then place it in some far away cell like Z1 invisible to others.

    VJR_0-1672286529422.png

     

    - Formula on next column B1

    VJR_1-1672286600267.png

     

    - Cell C1 will have formula as =EOMONTH(B1;0)+1

    - Cell D1 will have formula as =EOMONTH(C1;0)+1 and so on

     

    Basically, you are calculating the End of Month of today's date and adding 1 to get the first day of next month.

     

    This way whenever you open the excel sheet it will automatically update the first cell as per today's date and then the subsequent columns as per that date.

  • SunnyJoshi Profile Picture
    14 on at
    • Yes this was the way i used but my concern was when people play with file they add/remove the columns which makes the formulas ineffective. But thank you so much. If you still can provide anything which helps me.
  • SunnyJoshi Profile Picture
    14 on at

    It can’t help the actual end user. It won’t be user as it will be having 10k+ rows and only 10 columns which will create 40k+ rows.

  • Verified answer
    VJR Profile Picture
    7,635 on at

    Hi @SunnyJoshi 

     

    Sure, I can help you with the solution you want in this case.

    If you have noticed I have also mentioned about inserting the formulas via PAD too. You can simply use the "Set cell value" and write the Formulas in the cells when the Flow runs.

     

    If you want to do the date calculation via PAD actions then it will be a bit tedious. 

    But it is as below.

     

    VJR_0-1672369505883.png

     

    Copy-Paste the below code in a blank Flow editor and modify as required.

    DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateOnly CurrentDateTime=> CurrentDateTime
    DateTime.Add DateTime: CurrentDateTime TimeToAdd: 1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> ResultedDate
    Text.ConvertDateTimeToText.FromCustomDateTime DateTime: ResultedDate CustomFormat: $'''01/MM/yyyy''' Result=> StartDate
    DateTime.Add DateTime: StartDate TimeToAdd: 1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> NextDay
    Text.ConvertDateTimeToText.FromCustomDateTime DateTime: NextDay CustomFormat: $'''dd/MM/yyyy''' Result=> NextDay
    Display.ShowMessageDialog.ShowMessage Message: $'''The Start date is: %StartDate%
    The next date is: %NextDay%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed2
    

  • SunnyJoshi Profile Picture
    14 on at

    Thank you this solved my problem.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard