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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
MikeDubya
Helper I
Helper I

Need True and False in a Slicer, but nothing is True in data as of yet

Hello, 

I have a need for a slicer that only shows rows that have a flag of true. Unfortunately, my data currently only has data with the false flag.

 

I have tried a few differnet things, but really no luck. The false data continues to show when right now, nothing should be showing in my table visual. 

 

The Flag is based off of a Calculated column. If a date is in between a From Date and To Date, it is TRUE, else it is FALSE.

Currently what I see is this:

User IDTaskCountBetween Dates
1A50FALSE
2A43FALSE
3B2FALSE
4C1FALSE
5D700FALSE

 

And my slicer looks like this:

MikeDubya_0-1718209021975.png

Because there are currently no rows that are true, it isn't an option.

 

What I want to see is this:

User IDTaskCountBetween Dates
    
    
    
    
    

 

And if a True ever shows up, then this:

User IDTaskCountBetween Dates
5Misc700TRUE

 

But since I have nothing with True currently, I can't set up the slicer correctly.

I have tried a T/F Table and a Switch measure that gave me True, like this:

MikeDubya_1-1718209575432.png

but it didn't work for me.

This is the switch measure: 

TF_SWITCH =
SWITCH(
    SELECTEDVALUE('T/F'[T/F]),
    "True", CALCULATE(MAX('TABLE'[USER_ID]), FILTER('TABLE', [BETWEEN_DATES] <> FALSE())),
    "False", CALCULATE(MAX('TABLE'[USER_ID]), FILTER('TABLE', HLD_MAIN[BETWEEN_DATES] = FALSE()))
)
 
Admittedly, I may not have that set up correctly. I was/am a bit confused on what the first field in Calculate should be. I figured one of the fields in the table that is being displayed, but maybe I am wrong. 
 
Any help would be appreciated!
1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Instead of a switch measure, maybe try creating a relationship from your T/F table to your fact table on the true/false column. Then the T/F slicer should automatically filter 'TABLE'.

View solution in original post

2 REPLIES 2
MikeDubya
Helper I
Helper I

I tried that earlier and it didn't work. That's because I tried joining the wrong table. This was the solution. Thank you!

AlexisOlson
Super User
Super User

Instead of a switch measure, maybe try creating a relationship from your T/F table to your fact table on the true/false column. Then the T/F slicer should automatically filter 'TABLE'.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors