Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
brianhawley
Frequent Visitor

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 4
sanjyot_firke
Helper I
Helper I

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

Guirikiki
Frequent Visitor

Hello,

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

sandeephijam
Helper I
Helper I

Hi There,

 

See by Providing the Alternate Result as well.

SELECTEDVALUE(<columnName>[, <alternateResult>])

 

Or else you can also try the HASONEVALUE( ) function as well

 

IF(HASONEVALUE(<columnName>), VALUES(<columnName>), <alternateResult>).

 

Use SELECTEDVALUE instead of VALUES in DAX - DAX | Microsoft Learn

 

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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.