Forum Discussion

dolevh's avatar
dolevh
Icon for Helper II rankHelper II
4 years ago
Solved

a new column in modeling with aggregation

Hi All,    I have this table:  ID   StartDate   EndDate   Price 123   1/1/21   1/31/21   123   2/1/21   2/28/21   10 123   3/1/21   3/31/21   10 123   4/1/21   4/3...
  • jdbuchanan71's avatar
    4 years ago

    That would be like this.

    CountofNum = 
    VAR _Start =
        CALCULATE (
            MIN ( 'Table'[StartDate] ),
            ALLEXCEPT ( 'Table', 'Table'[ID] )
        )
    RETURN
        IF (
            'Table'[Price] = BLANK (),
            BLANK (),
            IF ( 'Table'[StartDate] = _Start, 1, 0 )
        )