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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MLUM
Helper I
Helper I

Need Help Making a Date Slicer Ignore Flagged Rows

Hi!

 

In Power BI, i have a table with two types of records, temporary records that vary by day, and permanent records that stay the same no matter the date. I need to be able to put a table and a date slicer on a page. I want the date slicer to impact the rows that are flagged 0 which are the temporary records but i want it to always show the records flagged 1 which are the permanent records no matter which dates are selected on the date slicer. I have not had any luck getting this to work

 

Ex Data: Basically i need my date slicer when filtered for 11/1/22 to show everyone (Tim does not have a date because he is a permanent record), and if the slicer has a different date it will still show Tim but not the others



NameLocationFlagDate
TimKentucky1 
JoeBoston011/1/22
SaraTampa011/1/22
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MLUM 

 

Please try this:
For better testing, I did some change to the data which you provided, here's the sample data:
Table:

vzhengdxumsft_2-1732514462389.png

 

Then add a calculated table:

 

Table 2 = FILTER(
		VALUES('Table'[Date]),
		'Table'[Date] <> BLANK()
	)

 

vzhengdxumsft_3-1732514475354.png

 

Next, create a measure:

 

_Flag =
VAR _Slicer =
    VALUES ( 'Table 2'[Date] )
RETURN
    IF (
        ISBLANK ( SELECTEDVALUE ( 'Table'[Date] ) ),
        1,
        IF ( SELECTEDVALUE ( 'Table'[Date] ) IN _Slicer, 0 )
    )

 

Finally, create a slicer with the field Table 2[Date] and replace the Table[Flag] with the measure[_Flag] in the table visual, the result is as follow:

vzhengdxumsft_6-1732514567787.pngvzhengdxumsft_7-1732514615399.png

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @MLUM 

 

Please try this:
For better testing, I did some change to the data which you provided, here's the sample data:
Table:

vzhengdxumsft_2-1732514462389.png

 

Then add a calculated table:

 

Table 2 = FILTER(
		VALUES('Table'[Date]),
		'Table'[Date] <> BLANK()
	)

 

vzhengdxumsft_3-1732514475354.png

 

Next, create a measure:

 

_Flag =
VAR _Slicer =
    VALUES ( 'Table 2'[Date] )
RETURN
    IF (
        ISBLANK ( SELECTEDVALUE ( 'Table'[Date] ) ),
        1,
        IF ( SELECTEDVALUE ( 'Table'[Date] ) IN _Slicer, 0 )
    )

 

Finally, create a slicer with the field Table 2[Date] and replace the Table[Flag] with the measure[_Flag] in the table visual, the result is as follow:

vzhengdxumsft_6-1732514567787.pngvzhengdxumsft_7-1732514615399.png

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Although this did work, is there any way to make it work without showing the flag in the table? If i remove it from the table and try to just add it as a filter on the table it doesn't work.

This works! Thanks so much!!

gmsamborn
Super User
Super User

Hi @MLUM 

 

You could a measure like this to filter your visual.  

 

 

Include = 
VAR _SelDt = MAX( 'Date'[Date] )
VAR _Result =
    IF(
        SELECTEDVALUE( 'Table'[Flag] ) = 1
            || (
                SELECTEDVALUE( 'Table'[Flag] ) = 0
                    && SELECTEDVALUE( 'Table'[Date] ) = _SelDt
                ),
        1,
        0
    )
RETURN
    _Result

 

 

Let me know if you have any questions.

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

So the only issue with using a date table, is the filter im using is a modified date which is a date for all dates other than the current date. For current date it shows "Today", so it is a text field rather than an actual date field.

 

Thanks!

I would like to help but I'm a little unclear about your requirements.

 

Can you provide the following?

 

1)  Please provide sample data that covers your issue or question completely.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

 

2) Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

 

3) Please explain how you would expect to get from step 1 to 2.

 

4) If possible, please show your past attempts at a solution.

 

 

A .pbix file with sample data would be best.

 

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.