Forum Discussion

xonder's avatar
xonder
Icon for Helper I rankHelper I
5 years ago
Solved

Boolean statement if item exists between tow dates

I collect data of advertised vehicles at irregulars intervals. Each time I collect data, I get a snapshot of what is currently being advertised along with a time stamp.   05.11.2020 is the first da...
  • amitchandak's avatar
    5 years ago

    xonder , Create a measure like this and try with ID

     

    measure =
    var _max = maxx(allselected(Table), Table[Date])
    var _tab =summarize(filter(Table, Table[Date] =_max),Table[ID])
    return
    calculate( count(Table[ID]), filter( Table, Table[Date] <_max && not(Table[ID] in _tab)))

  • v-deddai1-msft's avatar
    5 years ago

    Hi xonder ,

     

    You can create two measure for counting ID that are marked "Sold" and those marked "For Sale":

     

    ID For Sale  = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Status] = "For Sale"))
    ID Sold  = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Status] = "Sold"))

     

     

    Put them in values  and it will show as legends.

     

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

     

    Best Regards,

    Dedmon Dai