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
JimJim
Post Patron
Post Patron

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?
 
 
1 ACCEPTED SOLUTION
JimJim
Post Patron
Post Patron

 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.

View solution in original post

6 REPLIES 6
JimJim
Post Patron
Post Patron

 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.

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,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Pragati11
Super User
Super User

Hi @JimJim ,

 

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

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

v-lid-msft
Community Support
Community 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,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@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. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.