Forum Discussion

EWBWEBB's avatar
EWBWEBB
Icon for Helper III rankHelper III
4 years ago
Solved

Consecutive days in date range

Hiya   There are a multitude of posts on this and I've got some way with the SQLBI video on youtube but keep getting stuck with my specific issue.    I need to report on sickness within the busin...
  • v-zhangti's avatar
    4 years ago

    Hi, EWBWEBB 

     

    You can try the following methods.

    Consecutive days = 
    CALCULATE(COUNT('Table'[Date]),FILTER('Table',[ID]=EARLIER('Table'[ID])))
    Status = IF([Consecutive days]>=28,"LTS","STS")

     

    Because of the small amount of sample data provided, there are some special cases that we have not been able to encounter yet. You can refer to the following link to upload PBIX example files, where sensitive information can be removed in advance.

    How to provide sample data in the Power BI Forum - Microsoft Power BI Community

     

    Best Regards,

    Community Support Team _Charlotte

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