Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello everyone, I have been struggling to find a solution to this. I have a table with 2 columns. The dates [1/1/2021, 1/2/2021.. ], Another column saying 1 if an event has occurred, and blank otherwise. I have been trying to find a way to calculate the max consecutive days an event has occurred. It would be great if I could get a solution
Solved! Go to Solution.
Hi, @spandana ;
According to your desscription, I think Jihwan_Kim’s reply is a good idea. In addition, you also could create a column and measure to calculate. as follows:
1.create a column
group = SUMX(FILTER(ALL(Data),[Date]<=EARLIER(Data[Date])),[Event]-1)
2.create a measure
maxDays =
var _table=SUMMARIZE('Data',[group],"count",CALCULATE(COUNTROWS('Data'),FILTER(ALL(Data),[group]=MAX([group]))))
return MAXX(_table,[count])
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you! Really helpful!
Hi, @spandana ;
According to your desscription, I think Jihwan_Kim’s reply is a good idea. In addition, you also could create a column and measure to calculate. as follows:
1.create a column
group = SUMX(FILTER(ALL(Data),[Date]<=EARLIER(Data[Date])),[Event]-1)
2.create a measure
maxDays =
var _table=SUMMARIZE('Data',[group],"count",CALCULATE(COUNTROWS('Data'),FILTER(ALL(Data),[group]=MAX([group]))))
return MAXX(_table,[count])
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 104 | |
| 81 | |
| 66 | |
| 50 | |
| 45 |