cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dalacarelia_196
Helper IV
Helper IV

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (53,598)