cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Phineas
Post Partisan
Post Partisan

Gallery Item DateDiff

I there a way to run a date diff condition on a specifc item in a Gallery and its 'date'.

 

I have a Gallery. I have a Toggle.

 

In the Toggle default I have 

(CountRows(Fitler(Gallery.AllItems, Field1="Noncomplaint"))) =0 &&

(CountRows(Fitler(Gallery.AllItems, StartsWith(GalleryField.Text, "Title1"))) >0 &&

(CountRows(Fitler(Gallery.AllItems, StartsWith(GalleryField.Text, "Title2"))) >0 &&

(CountRows(Fitler(Gallery.AllItems, StartsWith(GalleryField.Text, "Title3"))) >0 - from this point I need the specific date of issue

                                                                                                                              associated with Title3 compared to Today; if date

                                                                                                                              of issue greater than Today Toggle 'true'  

2 REPLIES 2
rubin_boer
Super User
Super User

hi @Phineas It seems you have two requirements; the toggle and gallery are two controls in the canvas and based on the gallery the toggle needs to be true or false:

req 1: overall compliance and then

req 2: which item is causing the noncompliance? 

 

req1:

//compliance is either true or false

CountRows(Filter(YourGallery.AllItems,DateDiff(Today(), YourDateColumn, Days)<0))

 

req 2:

If(
    And(
        ThisItem.Field1="Noncompliant", 
        "Title1" in ThisItem.Text, 
        "Title2" in ThisItem.Text, 
        "Title3" in ThisItem.Text,
        DATEDIFF(Today(),YourDateValue,Days) < 0
        )
    ,"Noncompliant"
    ,"Compliant"
)

 

 

Edited Reply:

 

Thank you.

 

Let's make sure we are on the same page.

 

1. The Gallery needs to display ALL records, not just all 'Compliant' or 'Noncompliant'

2. Gallery MUST contain AT LEAST either

    - Title1 - Title4; and, Title4 can be no more than two years old

      or

    - Title1 - 5; and, Title5 can be no more than two years old

With you method would I not also need to factor in the difference periodicities of each, yes?

 

Some Titles are good for 365 days, some 730, some 1095.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,138)