cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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
HadynM
Kudo Kingpin
Kudo Kingpin

Hi @dalacarelia_196

 

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.

Hadyn

View solution in original post

tommyly
Continued Contributor
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.

View solution in original post

4 REPLIES 4
HadynM
Kudo Kingpin
Kudo Kingpin

Hi @dalacarelia_196

 

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.

Hadyn

tommyly
Continued Contributor
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.

v-sheyu-msft
Community Support
Community Support

HI @dalacarelia_196,

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

 

I made a test .

I created a SP list named “test2.

4.PNG

2.PNG

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.

Jippeeee thanx

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,623)