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 Apps / Date operation only wi...
Power Apps
Answered

Date operation only with day and month from sharepoint

(0) ShareShare
ReportReport
Posted on by 228

Hello,

 

i hope anyone have an idea for my problem.

 

I have a sharepoint list with date fields date_from an date_to.

 

I want to check in powerapps if today's date is within date_from and date_to. The challenge is that I only want to check the day and month and not the year

 

Example:
date_from: 01.10
date_to: 01.03

--> But the Datefield in Sharepoint is with years

 

There are 2 problems here.

1. I only need day and month
2. As in my example, this can also be year-round

 

My example Formula:
Filter (SharePointList; date_from> = today () and date_to <= Today ())

Maybe someone has an idea how to do that

Categories:
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Tamer66 ,

    Do you want to compare date and month not including year?

    I suggest you try Text and DateValue function.

    Using Text function can set the data's format and using DateValue can get the text's value.

    Try this formula:

    Filter(listname,DateValue(Text(date_from,"mm-dd"))>=DateValue(Text(Today(),"mm-dd")),
    DateValue(Text(date_to,"mm-dd"))<=DateValue(Text(Today(),"mm-dd"))
    )

    Here's a doc about how to format data for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-text

     

    Best regards,

    Community Support Team _ Phoebe Liu

  • Tamer66 Profile Picture
    228 on at

    Hi @v-yutliu-msft 

     

    thanks this works but when i have a date that is over the year, it's not working.

     

    This works fine:

    date_from_ 01.04

    date_to: 15.07

     

    This is still a Problem

    date_from: 01.10

    date_to: 01.02

     

    i have no idea how can i fix this problem

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Tamer66 ,

    Oh, I didn't think of this situation.

    So I suggest you use if statement to see whether the date is over the year.

    Try this formula:

    If(
     DateValue(Text(date_from,"mm-dd"))<DateValue(Text(date_to,"mm-dd")),
     ///from the same year
     Filter(listname,
     Date(Year(Today()),Month(date_from),Day(date_from))<=Today(),
     Date(Year(Today()),Month(date_to),Day(date_to))>=Today()
     ),
     DateValue(Text(date_from,"mm-dd"))>=DateValue(Text(date_to,"mm-dd")),
     ///from different year
     Filter(listname,
     Date(Year(Today()),Month(date_from),Day(date_from))<=Today(),
     Date(Year(Today())+1,Month(date_to),Day(date_to))>=Today()
     )
     )

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

  • Verified answer
    Tamer66 Profile Picture
    228 on at

    Hello @v-yutliu-msft ,

     

    i have a little bit problem to understand and use this Formula.

     

    This is what i use:

     

    If(
    DateValue(Text(Schonmass_von;"dd-mm"))<DateValue(Text(Schonmass_bis;"dd-mm"));

    Filter(Fischliste;
    Date(Year(Today());Month(Schonmass_von);Day(Schonmass_von))<=Today();
    Date(Year(Today());Month(Schonmass_bis);Day(Schonmass_bis))>=Today()
    );
    DateValue(Text(Schonmass_von;"dd-mm"))>=DateValue(Text(Schonmass_bis;"dd-mm"));

    Filter(Fischliste;
    Date(Year(Today());Month(Schonmass_von);Day(Schonmass_von))<=Today();
    Date(Year(Today())+1,Month(Schonmass_bis);Day(Schonmass_bis))>=Today()
    )
    )

     

    The sharepoint Field in Datevalue "(DateValue(Text(Schonmass_von;"dd-mm"))" can not be found. 

     

    I try it in a datatable and in a gallery an get the same Problem

     

    what am I doing wrong

     

    2019-07-12_14-45-49.png

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard