Forum Discussion

JimJim's avatar
JimJim
Icon for Responsive Resident rankResponsive Resident
6 years ago
Solved

Measure overrides slicer selection

Hi Guys,

 

I have the following measure:

 

Is Compliant = SWITCH(SELECTEDVALUE('Timesheet Compliance'[IsCompliant]),1,"✓","☓")
 
The problem I have is the measure returns an "☓" for every other row, even the ones that aren't in the slicer selection. As a result, when I filter my page for North America, the table shows all users from all regions and the users from other regions have an "☓"
 
How can I ensure that the measure only calculates rows that meet the slicer selection?
 
 
  •  Guys, I'm sorry but I completely complicated this whole thing. I simply had to remove the ELSE part of the measure. My new measure is:

     

    Is Compliant = SWITCH(SELECTEDVALUE('Timesheet Compliance'[IsCompliant]),1,"✓",0,"☓")
     
    I failed to tell you that the only values in IsCompliant are 1 and 0, if I had told you this I'm sure someone would have gave me the correct answer straight away.
     
    Thanks to everyone who contributed.

6 Replies

  • JimJim wht are the unique Is Compliant values? in the meantime try this

     

    Is Compliant = 
    SWITCH(
    SELECTEDVALUE(TRUE(),
    'Timesheet Compliance'[IsCompliant])=1,"✓",
    'Timesheet Compliance'[IsCompliant])<>1,"☓"
    )

    Would appreciate Kudos 🙂 if my solution helped. 

  • v-lid-msft's avatar
    v-lid-msft
    Icon for Community Support rankCommunity Support

    Hi JimJim ,

     

    We can try to use the following measure to meet your reqirement:

     

    Is Compliant =
    IF (
        COUNTROWS ( 'Timesheet Compliance' ) = 0
            || MAX ( 'Timesheet Compliance'[IsCompliant] )
                = BLANK (),
        BLANK(),
        IF (
            MAX ( 'Timesheet Compliance'[IsCompliant] ) = 1,
            "✓",
            "☓"
        )
    )
    

     

    If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


    Best regards,

     

    • parry2k's avatar
      parry2k
      Icon for Super User rankSuper User

      JimJim Is your problem solved? Can you accept a solution, it will help others with similar questions. Thanks!

       

      Would appreciate Kudos 🙂 if my solution helped.

  • Hi JimJim ,

     

    What values does your column 'Timesheet Compliance'[IsCompliant] have?

     

    Thanks,

    Pragati

  • JimJim's avatar
    JimJim
    Icon for Responsive Resident rankResponsive Resident

     Guys, I'm sorry but I completely complicated this whole thing. I simply had to remove the ELSE part of the measure. My new measure is:

     

    Is Compliant = SWITCH(SELECTEDVALUE('Timesheet Compliance'[IsCompliant]),1,"✓",0,"☓")
     
    I failed to tell you that the only values in IsCompliant are 1 and 0, if I had told you this I'm sure someone would have gave me the correct answer straight away.
     
    Thanks to everyone who contributed.
    • v-lid-msft's avatar
      v-lid-msft
      Icon for Community Support rankCommunity Support

      Hi JimJim ,

       

      Glad to hear that you have resolved your problem. Thank you for sharing this wonderful solution, would you please kindly mark your shared solution as an answer so that it can benefit more users?  If you have any other questions about this scenario, please kindly ask here and we will try to resolve it.


      Best regards,