Forum Discussion

brianhawley's avatar
brianhawley
Frequent Visitor
3 years ago

Selectedvalue text not working in a filter where hard-coded text does

Hi!

 

I'm trying to filter a table by name.  I'm using a calculate statement and filtering on a Time Intelligence table that's set up by weeks; that part of the filter works.

 

What isn't working is when I try to add a filter for employee name.  I've created a duplicate of my original table, deleted the columns, and removed duplicates to generate a list of unique names.  I created a slicer that let's me select a name, and I created a measure:

Selected Employee= selectedvalue('Employee Table'[Employee]).
 
I've tried comparing the values in a filter with the measure directly and via a set variable and it isn't working.  If I hard code in the Selected Employee, e.g. Filter(Worklist,Worklist[Employee]="Fred Flintstone"), the values update.  Below are the current column formulas that I feel should be working.  Can anyone point me to what I'm missing?

Comparing to a variable:
Name Count = var EmployeeName = [Selected Employee] Return
Calculate(count(Worklist[Project Name]),Filter(Worklist,Worklist[Employee]=EmployeeName),DATESBETWEEN(Worklist[Creation Date].[Date],('Time Intelligence'[Date].[Date]),('Time Intelligence'[Date+6].[Date])))

Comparing to a measure:

Calculate(count(Worklist[Project Name]),Filter(Worklist,Worklist[Employee]=[Selected Employee]),DATESBETWEEN(Worklist[Creation Date].[Date],('Time Intelligence'[Date].[Date]),('Time Intelligence'[Date+6].[Date])))

Many thanks!

4 Replies

    • brianhawley's avatar
      brianhawley
      Frequent Visitor

      Thanks for looking at this.  The generated names table has no duplicate values, so there isn't an alternate result.  I tried both suggestions for good measure and there was no effect. 

      If I place the [Selected Employee] measure into a Card visual, the single name appears and changes based on what I've selected in the slicer, which is set to single selection.

  • Guirikiki's avatar
    Guirikiki
    Frequent Visitor

    Hello,

    I have the same problem. Do you find a solution ? Thank you.

  • Was there any solution found to this issue? We are facing the same issue.