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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Jos13
Helper III
Helper III

Filter not working

Hi Team,

I just have to find whether a particular employee's data is there in the table by filtering month and task. I have created a measure as follows.

Measure = IF(SELECTEDVALUE('Table'[EmpId])=VALUES('Table'[EmpId]),"Yes","No")
But this is not working as expected.
image 1.png
Kindly help me on this.
1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Jos13 

 

Sure, try this.

Measure = 
IF( 
    ISFILTERED( 'Table'[Empid] ),
    IF( NOT ISEMPTY( 'Table' ), "Yes", "No" )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

View solution in original post

7 REPLIES 7
Jos13
Helper III
Helper III

Hi,

The above mentioned measures return a value even if the employee id is not selected. This measure should return a value only when the employee id is selected otherwise it can return blank.

 

Thanks,

Jos

Mariusz
Community Champion
Community Champion

Hi @Jos13 

 

Sure, try this.

Measure = 
IF( 
    ISFILTERED( 'Table'[Empid] ),
    IF( NOT ISEMPTY( 'Table' ), "Yes", "No" )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

tex628
Community Champion
Community Champion

Can you make your slicer single select or do you need to have the ability to select several employees? 

If that is the case, how do you want the logic to behave when there is more than one employee selected?

/ J


Connect on LinkedIn

Single select would be fine. But if I make emp id slicer single select, is it possible for me to select other taks ? Report has to work in the following way:

User selects month first then task and then employee.

 

Thanks,

Jos

amitchandak
Super User
Super User

@Jos13 , try like

calculate(if(Max('Table'[EmpId]) =SELECTEDVALUE('Table'[EmpId]),"Yes","No"),values('Table'[EmpId]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Mariusz
Community Champion
Community Champion

Hi @Jos13 

 

Try this, 

Measure = IF( NOT ISEMPTY( 'Table' ), "Yes", "No" )

 If not what you need, please provide the expected outcome.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

tex628
Community Champion
Community Champion

Change it to,

Measure = IF(COUNTROWS('Table')=1,"Yes","No")


Br,
J


Connect on LinkedIn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.