Dynamic Filter for a Slice

Hi there,

Please help. I've created a table where the user can input a [start date] within the detail view / quick edit. There is a log file that has [session date] rows and I'm trying to filter the log file to only show 1 year from the start date.

Using this expression: (client log[session date] = (annual audit[start date])) 

 I get a green tick. (Client Log[Session Date]) is equal to (Annual Audit[Start Date])

However, when I change the expression to: (client log[session date] >= (annual audit[start date]))

I get a red cross. Arithmetic expression '(Client Log[Session Date] >= Annual Audit[Start Date])' does not have valid input types

I've used >= and <= on other table using a fixed date e.g. "01/12/22" and that works fine.

I've checked the column types and they are both set to Date.

Any ideas? Do you need more information to solve this one?

Thanks in advance

 

Solved Solved
0 1 287
1 ACCEPTED SOLUTION

client log[session date] = (annual audit[start date])


This expression is comparing one List to another List. The List of ALL values in [session date] column of the entire client log table, compared to ALL values in [start date] column of annual audit table. This is not what you want.

First, Slices compare each individual record one by one, you don't have to re-state the table name. (see also)

Second, assuming the annual audit table only has a single record, you still need to pull that single record's value out, instead of using the List value.

 

Your proper expression should be this:

[session date] = ANY( annual audit[start date] )

And from there you can replace '=' with '>=' or '<'

 

View solution in original post

1 REPLY 1

client log[session date] = (annual audit[start date])


This expression is comparing one List to another List. The List of ALL values in [session date] column of the entire client log table, compared to ALL values in [start date] column of annual audit table. This is not what you want.

First, Slices compare each individual record one by one, you don't have to re-state the table name. (see also)

Second, assuming the annual audit table only has a single record, you still need to pull that single record's value out, instead of using the List value.

 

Your proper expression should be this:

[session date] = ANY( annual audit[start date] )

And from there you can replace '=' with '>=' or '<'

 

Top Labels in this Space