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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Function for year and ...
Power Automate
Unanswered

Function for year and week number dynamically

(0) ShareShare
ReportReport
Posted on by 45
Hi,
 
Pls help what causing the error. 
 
My ideal result is:
'TOSS Site Progress Report_2025_W13.xlsx'
 
 
 
concat(year(convertFromUtc(utcNow(),'Korea Standard Time')), '_W', weekOfYear(convertFromUtc(utcNow(),'Korea Standard Time')))
 
 
Categories:
I have the same question (0)
  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at
    You can do this in one expression, but I've split it out so it's easier to read.

    Compose 1 (Date Now):
    convertFromUtc(utcNow(),'Korea Standard Time')

    Compose 2 (Add WK Num)
    concat(
    	'TOSS Site Progress Report_',
    	formatDateTime(outputs('Date_Now'),'yyyy'),
    	'_W',
    	formatNumber(
    		add(div(dayOfYear(outputs('Date_Now')),7),1),
    		'00'
    	),
    	'.xls'
    )

    Result:

  • jeongkim Profile Picture
    45 on at
    it works thanks!
    Can you also show me how to combine 2 Composes into 1 action pls? 
  • CU26032143-0 Profile Picture
    2 on at
    The two composes as one compose/action is:
     
    concat(
    	'TOSS Site Progress Report_',
    	formatDateTime(convertFromUtc(utcNow(),'Korea Standard Time'),'yyyy'),
    	'_W',
    	formatNumber(
    		add(div(dayOfYear(convertFromUtc(utcNow(),'Korea Standard Time')),7),1),
    		'00'
    	),
    	'.xls'
    )


    Don't forget to mark as solved!

    d(-_-)b
  • Suggested answer
    DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at
    Sorry, I replied under a different account.
    Still the same answer though

    The two composes as one compose/action is:
     
    concat(
    'TOSS Site Progress Report_',
    formatDateTime(convertFromUtc(utcNow(),'Korea Standard Time'),'yyyy'),
    '_W',
    formatNumber(
    add(div(dayOfYear(convertFromUtc(utcNow(),'Korea Standard Time')),7),1),
    '00'
    ),
    '.xls'
    )

    Don't forget to mark as solved!

    d(-_-)b
  • jeongkim Profile Picture
    45 on at
    do you think it would work if I amend like this? 
     
    Desired outputs are:
     
    one is 'TOSS Site Progress Report_20250331'
    another is 'TOSS Site Progress Report_2025_W14'
     
    if below code is okay then how can I adjust the code you shared for Year & Week number in one action? 
     
     
     
  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at
    You can produce any file name you want using the concat function:
     
    TOSS Site Progress Report_20250331
    concat(
    	'TOSS Site Progress Report_',
    	formatDateTime(convertFromUtc(utcNow(),'Korea Standard Time'),'yyyyMMdd'),
    	'.xls'
    )
     
    TOSS Site Progress Report_2025_W14
     
    As per the solution provided
     
  • jeongkim Profile Picture
    45 on at
    Thanks I got desired outputs!
  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at
    @jeongkim

    OK Good!
    Don't forget to mark solution as accepted

    d(-_-)b

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard