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
NorbertG
Helper I
Helper I

Slicer for dates between

Hi everyone.
Im having troubles with table visual. The thing I want to achieve is to show certain rows which's [date_created] is earlier than the date selected on slicer if certain row's column value is 1 and show the rest regularely which's certain row's column value is 0. My slicer uses [date_created] as field. I don't know if this is helpful but rows with value 1 have blank in date_end.

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @NorbertG ,

I created some data:

vyangliumsft_0-1698121204245.png

 

Are you referring to the fact that when the row contains a 1, only data less than the slicer date is displayed, and when the row does not contain a 1, the data can be displayed?

Here are the steps you can follow:

1. Create measure.

Flag =
var _date=SELECTEDVALUE('Table 2'[Date])
var _text=
MAX('Table'[Row1])&"-"&MAX('Table'[Row2])&"-"&MAX('Table'[Row3])
var _if=
IF(
    CONTAINSSTRING(
        _text,1)=TRUE(),0,1)
return
IF(
    _if<>0,_if,
    IF(
    _if=0&&MAX('Table'[Date])<SELECTEDVALUE('Table 2'[Date]),1,_if))

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1698121204246.png

3. Result:

If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

vyangliumsft_2-1698121249100.png

 

Best Regards,

Liu Yang

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

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @NorbertG ,

I created some data:

vyangliumsft_0-1698121204245.png

 

Are you referring to the fact that when the row contains a 1, only data less than the slicer date is displayed, and when the row does not contain a 1, the data can be displayed?

Here are the steps you can follow:

1. Create measure.

Flag =
var _date=SELECTEDVALUE('Table 2'[Date])
var _text=
MAX('Table'[Row1])&"-"&MAX('Table'[Row2])&"-"&MAX('Table'[Row3])
var _if=
IF(
    CONTAINSSTRING(
        _text,1)=TRUE(),0,1)
return
IF(
    _if<>0,_if,
    IF(
    _if=0&&MAX('Table'[Date])<SELECTEDVALUE('Table 2'[Date]),1,_if))

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1698121204246.png

3. Result:

If the results don't meet your expectations, can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you

vyangliumsft_2-1698121249100.png

 

Best Regards,

Liu Yang

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

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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.