Forum Discussion

Birthe's avatar
Birthe
New Member
3 years ago
Solved

Selectedvalue and calculated columns

I have been struggling all day now. Can someone please help me? To simplify, I have a table (+1000 records) with contracts, all having a start and an end date:   Contractnr ContractFrom (date)...
  • ERD's avatar
    3 years ago

    Birthe ,

    You can try this measure:

    DateBetween =
    VAR _from =
        SELECTEDVALUE ( 'Table'[ContractFrom] )
    VAR _to =
        SELECTEDVALUE ( 'Table'[ContractUntil)] )
    VAR _date =
        SELECTEDVALUE ( 'Date'[Date] )
    RETURN
        IF ( _date >= _from && _date <= _to, 1, 0 )