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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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