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 Apps / Dataverse calculated c...
Power Apps
Unanswered

Dataverse calculated column to extract the year from date

(0) ShareShare
ReportReport
Posted on by 2,295
This seems the easiest thing in the world: a calculated column in dataverse like;
 
Year(MyDate)
 
But it returns the error:
Year cannot be performed on this input without a time zone conversion, which is not supported in formula columns.
Categories:
I have the same question (0)
  • Mark Nanneman Profile Picture
    991 Super User 2025 Season 2 on at
    I never found a way to accomplish this when I wanted to months ago--but there were other ways to do what I wanted that didn't even require the column.  If you absolutely must have a year column, you can create a plugin or flow to auto populate it off of your date column when the record is created or updated (to handle new records going forward)--and you can retroactively bulk populate your year column by doing an export to excel, using some quick excel formulas to fill in that column, and then importing the whole table back into dataverse for updates.

    Just some thoughts.
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Year function only works on UTC dates
  • WebPortal Profile Picture
    2,295 on at
    @Mark Nanneman
     
    Sure, I have the year in Power Fx and I use it to filter a large Dataverse table.
    The issue is delegation. Thus, having the year on a column would help.
  • Suggested answer
    truc binh Profile Picture
    17 on at
    You can change field MyDate to Date Only or Timezone Independent. Then you can apply the Year function in Formula column
  • WebPortal Profile Picture
    2,295 on at
    @truc binh
     
    Thanks, but how may I do that?
     
    Here are the column specifications:
     
  • Mark Nanneman Profile Picture
    991 Super User 2025 Season 2 on at
    There's at least one option that works on large data sources with no delegation issues. 

    I have a demo I can share that uses a gallery of years to work like pages or filter selections.  It's created just using a simple sequence() function.



    Years Gallery:


    Formula for the dataverse gallery you want to filter by year:

     
    With(
     
        {
     
            startDate: DateTimeValue(Text(Date(gal_years_filter.Selected.Value,1,1),DateTimeFormat.UTC)),
     
            stopDate: DateTimeValue(Text(Date(gal_years_filter.Selected.Value,12,31),DateTimeFormat.UTC))
     
        },
     
        Sort(
     
            Search(
     
                Filter(
     
                    'Large Date Tables',
     
                    'Long Date' >= startDate And 'Long Date' <= stopDate
     
                ),
     
                txt_search.Value,
     
                Name
     
            ),
     
            'Long Date',
     
            SortOrder.Descending
     
        )
     
    )
     


    I've done versions of these where you can select multiple years from from your year gallery and it just finds the max and min from that collection to generate the start and stop filter dates.



    Example of the filtering:

    works very quickly,almost instant





    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!

    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff  |
  • Suggested answer
    ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    If you are forced to here is a weird way to do it.
     
    Add a new datetime column TestDateConstant which will default to January 1st 1900.
    The date that I want to extract the year from is called TestDate
    Create a formula field
    Text(DateDiff(TestDateConstant, TestDate, TimeUnit.Years) + 1900, "####")
     
    This gives you a text field with the year
     
  • Verified answer
    truc binh Profile Picture
    17 on at
    Hi @WebPortal,
     
    You can set in the box related to timezone below.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard