cancel
Showing results for
Did you mean:
Continued Contributor

Select and show data between dates

I am trying to solve this , How many BB is in the table between the dates in the table Function and to show that in a textbox . and its not  working ... pls help

Table name tblFunction
Logdates          Function
2018-01-01      BB
2018-01-01      BB
2018-01-02      BB
2018-01-02      AA
2018-01-03      AA
2018-01-03      BB
2018-01-03     BB
2018-01-04     AA
2018-01-04    AA
2018-01-04    BB
2018-01-04    BB
2018-01-05    AA

Datepcik_1 "2018-01-01 "
Datepick_2 "2018-01-04"
text( Sum(Filter(tblFunction, logdates > DatePick_1.SelectedDate, logdates < DatePick_2.SelectedDate), Function),BB ) )
2 ACCEPTED SOLUTIONS

Accepted Solutions
Kudo Kingpin

CountIf, or CountRows depending on your requirements, are probably what you're after.

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

Something like:

`CountIf(tblFunction, logdates >= DatePick_1.SelectedDate && logdates <= DatePick_2.SelectedDate && Function ="BB")`

Hope that helps.

Continued Contributor

You should be able to do either:

```Text(
Sum(tblFunction,    logdate > DatePick_1.SelectDate,    logdates < DatePick_2.SelectDate,    function = "BB"  )
)```

OR

```Text(
CountRows(    Filter(tblFunction,      logdate > DatePick_1.SelectDate,      logdates < DatePick_2.SelectDate,      function = "BB"    )  )
)```

You may want to make your boolean statement include equals, if you intend on considering dates that are equal as well.

4 REPLIES 4
Kudo Kingpin

CountIf, or CountRows depending on your requirements, are probably what you're after.

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

Something like:

`CountIf(tblFunction, logdates >= DatePick_1.SelectedDate && logdates <= DatePick_2.SelectedDate && Function ="BB")`

Hope that helps.

Continued Contributor

You should be able to do either:

```Text(
Sum(tblFunction,    logdate > DatePick_1.SelectDate,    logdates < DatePick_2.SelectDate,    function = "BB"  )
)```

OR

```Text(
CountRows(    Filter(tblFunction,      logdate > DatePick_1.SelectDate,      logdates < DatePick_2.SelectDate,      function = "BB"    )  )
)```

You may want to make your boolean statement include equals, if you intend on considering dates that are equal as well.

Community Support

Do you want to count the records that were in between the dates and contained “BB?

I created a SP list named “test2.

Set the Text property of label1 to:

`CountIf(test2,Logdates>=DatePicker1.SelectedDate&&Logdates<=DatePicker2.SelectedDate&&Function="BB")`

Also, you can Set the Text property of label1 to:

`CountRows(Filter(test2,Logdates>=DatePicker1.SelectedDate,Logdates<=DatePicker2.SelectedDate,Function="BB"))`

Regards,

eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Continued Contributor

Jippeeee thanx

Announcements

Celebrating the May Super User of the Month: Laurens Martens

@LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!