Forum Discussion

Jos13's avatar
Jos13
Helper III
6 years ago
Solved

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.
Kindly help me on this.
  • 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


     

7 Replies

  • tex628's avatar
    tex628
    Community Champion

    Change it to,

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


    Br,
    J

  • Mariusz's avatar
    Mariusz
    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


     

  • Jos13 , try like

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

  • 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

    • tex628's avatar
      tex628
      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

      • Jos13's avatar
        Jos13
        Helper III

        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

    • Mariusz's avatar
      Mariusz
      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