Hello!
I am having an if statement that filters on what date is selected but it does not work. What am I doing wrong?
Here is the code:
Filter(
Tabel1;
'Start - Date' = SelectedDate
)
The start date is formatted like this: 2-7-2020 (dd-mm-yyyy), it is a date column.
Selected date is formatted like this: https://gyazo.com/e5170504ba03ac6ccccc107c124f8331
Solved! Go to Solution.
Yeah I got this figured out, thank you though @v-siky-msft
My solution: I made a power automate flow that turned the whole column 'Start - Date' into a date column. I have done that using this formula:
if(empty(items('Apply_to_each_2')?['Start - Date']),null,addDays('1899-12-30',int(items('Apply_to_each_2')?['Start - Date']),'yyyy-MM-dd'))
At first it would give me an error since I have some empty rows in my file. That's why I added the if statement returning null when the value is empty.
Add the name of the DatePicker:
Filter( Tabel1; 'Start - Date' = DatePicker1.SelectedDate )
Or
Filter( Tabel1;Text( 'Start - Date',ShortDate)= Text(DatePicker1.SelectedDate,ShortDate) )
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
@Anonymous
What do you mean by “it does not work.” Are you getting an error? Or do no results simply appear with no error?
What datasource are you using? If SharePoint, what column type is Start - Date?
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
It is an Excel file and the column is a short date column @mdevaney
I am getting no errors, just no results
DataPicker is not a value I am using @eka24
The selecteddate is working. I put a label and then as the text value I put "SelectedDate"
Result: https://gyazo.com/94885e2138b93e946d9591c56b11a540
What does selectedDate represent, a Column name?
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
It is a variabele that I use to click on my agenda app:
https://gyazo.com/65278b20ebab7322446f413efefdc203
https://gyazo.com/6314ca176070b33e4aabf672bae29965
Since the formula is Onvisible, have you tried navigate to another screen and back.
Also if the selectedDate is in a label, put the name of the label4.Text in the formula instead of the variable name.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
It then takes it as a Text value, which we don't want. It is not compatible @eka24
The SelectedDate does change whenever I click on another date, so that one works.
Here you can see the SelectedDate is a date value: https://gyazo.com/07f8f04885692909610eb41b0ec9fb84
So the problem is with the Start - Date not being the same format, I guess?
Hi @Anonymous ,
Have you got this resolved? If not, I'm happy to help further.
I would suggest you display the 'Start - Date' Value from Excel table to a label by setting Text property to First('Table1').'Start - Date'.
Then you may find that the 'Start - Date' value is DateTime type and the time is 8:00 AM by default, even if the 'Start - Date' is formatted as Date in Excel.
Hence the filter code should be like this:
Filter(Table1,'Start - Date'=DateTimeValue(SelectedDate &" "& Time(8,0,0)))
Hope this helps.
Sik
User | Count |
---|---|
253 | |
106 | |
94 | |
50 | |
39 |