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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
rigelng1995
Frequent Visitor

'OR' include blank values in date slicer

Hi there

 

I have a table with 3 columns , SaleDate, ReceiveDate, and SaleAmount. 

 

SaleDate is not null by default, yet ReceiveDate can accept blank values. 

 

How do I create slicers so that the end users can filter for a certain ReceiveDate and then decide whether to include blanks or not. 

 

In other words. I want the following -

formula in slicer --- or ((ReceiveDate >= Slicermin and ReceiveDate <= Slicermax), isblank(ReceiveDate))

 

As shown in the screen shot below -  I want to be able to select from the 3rd of Jan until the 4th of Jan AND including blanks

Screenshot_39.png

 

Also found an interesting interaction while playing around with the slicer  - it seems that if you have blank values in the date column (ReceiveDate) the left most part of the slider actually represents the blank values. 

 

Screenshot_40.png

 

Thanks

Rigel   

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Date should not be joined with receive or uses cross join if have active join

measure =
var _min = minx(allselected(Date,Date[Date])
var _max = minx(allselected(Date,Date[Date])
var _maxval = if(isfiltered(Slicer[Allowblank]),max(Slicer[Allowblank]),blank())
return
if(_maxval ="Allowblank",
calculate(sum(table[Value]),filter(all(Table[Receive Date]),Table[Receive Date]>=_min && Table[Receive Date]>=_max && isblank(Table[Receive Date])))
,
calculate(sum(table[Value]),filter(all(date),Date,Date[Date]>=_min && Date[Date]>=_max))
)

For use relation and crossfilter refer :https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Date should not be joined with receive or uses cross join if have active join

measure =
var _min = minx(allselected(Date,Date[Date])
var _max = minx(allselected(Date,Date[Date])
var _maxval = if(isfiltered(Slicer[Allowblank]),max(Slicer[Allowblank]),blank())
return
if(_maxval ="Allowblank",
calculate(sum(table[Value]),filter(all(Table[Receive Date]),Table[Receive Date]>=_min && Table[Receive Date]>=_max && isblank(Table[Receive Date])))
,
calculate(sum(table[Value]),filter(all(date),Date,Date[Date]>=_min && Date[Date]>=_max))
)

For use relation and crossfilter refer :https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

 

 

 

is for checking, weather blank is allowed on not.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi ,

Can you please guide me what the "Slicer[Allowblan] is refering to? I can see you have mentioned it is to see weather blank is allowed on not. but this is a column in our table? or a slicer? not sure how to get this.

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.