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
jgtaveras
New Member

Null values on date filters

i have a query that has a condition that go like this: And (my_date > [some user entered value] or my_date is null), i was trying to do it with a page filter, but i don't know how to make it with that custom user-defined value since tried with an advance filter but that only sets it to a specific date.

 

Plz take into account that im new at this

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

Hi @jgtaveras

It seems your condition is 

my_date > [some user entered value] or my_date is null

 

When using a page filter, it hard date information inside, 

Currently, i can't find a way to use a page level filter with custom user-defined value.

 

Here is a workaround with custom user-defined value using Visual level filter.

to make it changes with user's selection, you need create measures.

 

If you have a date table "Datetable", then add [date] column in a slicer, users can select from this slicer, this selected value is called "custom user-defined value",

if so, then just cretae measures below 

selected=SELECTEDVALUE(Datetable[date])

flag = IF(MAX([Date])>[selected]||MAX([Date])<>BLANK(),1,0)

 

If user enter date on their own instead of selecting from the exsited column,

create three What If Parameter to define the "year", "month", "day" values.

Please read reference to learn how to do it.

 

then use these parameter in the measure

user-defined date = DATE([Parameter Value],[Parameter Value 2],[Parameter Value 3])

flag = IF(MAX([Date])>[user-defined date]||MAX([Date])<>BLANK(),1,0)
 
Finally add [flag] in the Visual level filter, and select "show values when item is 1"
 
5.png
 
 

 

 

 

Best Regards

Maggie

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @jgtaveras

It seems your condition is 

my_date > [some user entered value] or my_date is null

 

When using a page filter, it hard date information inside, 

Currently, i can't find a way to use a page level filter with custom user-defined value.

 

Here is a workaround with custom user-defined value using Visual level filter.

to make it changes with user's selection, you need create measures.

 

If you have a date table "Datetable", then add [date] column in a slicer, users can select from this slicer, this selected value is called "custom user-defined value",

if so, then just cretae measures below 

selected=SELECTEDVALUE(Datetable[date])

flag = IF(MAX([Date])>[selected]||MAX([Date])<>BLANK(),1,0)

 

If user enter date on their own instead of selecting from the exsited column,

create three What If Parameter to define the "year", "month", "day" values.

Please read reference to learn how to do it.

 

then use these parameter in the measure

user-defined date = DATE([Parameter Value],[Parameter Value 2],[Parameter Value 3])

flag = IF(MAX([Date])>[user-defined date]||MAX([Date])<>BLANK(),1,0)
 
Finally add [flag] in the Visual level filter, and select "show values when item is 1"
 
5.png
 
 

 

 

 

Best Regards

Maggie

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.