Forum Discussion
jordanxie
6 years agoHelper I
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 ...
- 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 } ) )
TomMartens
6 years agoSuper User
Hey,
can you please describe the business rule more detailed, I have difficulties to understand why material 2 get a 1 even if there are 2 two consecutive events in the past.
Assuming that the week is selected by a slicer.
What would be the value for material 2 is there is a value for week 2019-47?
Regards,
Tom
- jordanxie6 years agoHelper I
Hi,
At this point we are more concern based on the latest snapshot (Week 48). There would not be a slicer for the week.
If there was a a material 2 for 2019-47, then the count would be 4