Forum Discussion

jordanxie's avatar
jordanxie
Helper I
6 years ago
Solved

Consecutive Weeks for Material

Hi,   Want to create a measure to be used as a card view that counts the consecutive weeks a material is present. The format for the date is Yr-Wk# (2019-46).    Let's say we are in Wk 48 so the ...
  • v-eachen-msft's avatar
    6 years ago

    Hi jordanxie ,

     

    You could use the following measure:

    Measure =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            'Table',
            VALUE ( RIGHT ( 'Table'[Yr-Wk#], 2 ) )
                IN { WEEKNUM ( TODAY (), 1 ), WEEKNUM ( TODAY (), 1 ) - 1 }
        )
    )