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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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]))

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.