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

#### April 4th Copilot Studio Coffee Chat | Recording Now Available

Did you miss the Copilot Studio Coffee Chat on April 4th? This exciting and informative session with Dewain Robinson and Gary Pretty is now available to watch in our Community Galleries!   This AMA discussed how Copilot Studio is using the conversational AI-powered technology to aid and assist in the building of chatbots. Dewain is a Principal Program Manager with Copilot Studio. Gary is a Principal Program Manager with Copilot Studio and Conversational AI. Both of them had great insights to share with the community and answered some very interesting questions!     As part of our ongoing Coffee Chat AMA series, this engaging session gives the Community the unique opportunity to learn more about the latest Power Platform Copilot plans, where we’ll focus, and gain insight into upcoming features. We’re looking forward to hearing from the community at the next AMA, so hang on to your questions!   Watch the recording in the Gallery today: April 4th Copilot Studio Coffee Chat AMA