Using a parameter table to filter dates column

kerygma

New member
Joined
Jul 11, 2016
Messages
19
Reaction score
0
Points
0
I'm having the hardest time, using Ken Puls's Parameter table function (fnGetParameter) to work ... I'm getting different errors... the following error:

"Expression.Error: We cannot apply operator < to types DateTime and Date.Details:
Operator=<
Left=06/29/2016 12:00:00 AM
Right=06/30/2016"

I have the following in my query:
let
date1 = fnGetParameters("date1"),
date2 = fnGetParameters("date2"),
........
#"Filtered Rows" = Table.SelectRows(#"Filtered Rows1", each [Date of Service] >= (date1) and [Date of Service] <= (date2))
in
#"Filtered Rows"

Can't figure out what exactly is wrong, can't figure out how to format. Any help is much appreciated! I've tried #date(date1)... that doesn't work either.
Thanks again!
 
Try this:

Code:
[COLOR=#333333]let[/COLOR]
[COLOR=#333333]date1 = Date.From(fnGetParameters("date1")),[/COLOR]
[COLOR=#333333]date2 = Date.From(fnGetParameters("date2")),[/COLOR]
[COLOR=#333333]........[/COLOR]
[COLOR=#333333]#"Filtered Rows" = Table.SelectRows(#"Filtered Rows1", each [Date of Service] >= (date1) and [Date of Service] <= (date2))[/COLOR]
[COLOR=#333333]in[/COLOR]
[COLOR=#333333]#"Filtered Rows"

Hope that helps![/COLOR]
 
Worked like a charm. Thank you! I was looking all over the MSDN website for the correct M formula and couldn't find it, hard to tell which one is the correct one.

Thanks again!
 
Back
Top