Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

'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...
  • amitchandak's avatar
    6 years ago

    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-trend/ba-p/882970

     

    Appreciate your Kudos.