Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syk
Super User
Super User

Flag account if something has happened for 3 consecutive months

Hi everyone! I'm trying to identify when an account is uninsured for >= 3 months in a row.  My data (example in screenshot) will count each day that an account is uninsured. If the count is >1 it should show as uninsured for the whole month.

Syk_0-1644960772627.png

I need a way to flag the accounts that have been uninsured for >=3 months reguardless of when it happened. In the screenshot below, I'd need to flag accounts 456 and 789 but NOT 123. I hope this makes sense, please let me know if you have additional questions.

Syk_1-1644960916242.png

 

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Syk 

 

Try this measure to find the Accounts with 3 month uninsured 1 in line:

 

Flag = 
Var _A =ADDCOLUMNS('Table',"3M",CALCULATE(sum('Table'[uninsured]),filter(ALLEXCEPT('Table','Table'[account]),'Table'[date] in DATESINPERIOD('Table'[date],EARLIER('Table'[date]),-3,MONTH))))
Var _B = filter(_A,[3M]=3)
return
COUNTROWS(_B)

 

then you can use that in the conditional formatting of your visual.

 

output:

VahidDM_0-1644964096932.png

 

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @Syk 

 

Try this measure to find the Accounts with 3 month uninsured 1 in line:

 

Flag = 
Var _A =ADDCOLUMNS('Table',"3M",CALCULATE(sum('Table'[uninsured]),filter(ALLEXCEPT('Table','Table'[account]),'Table'[date] in DATESINPERIOD('Table'[date],EARLIER('Table'[date]),-3,MONTH))))
Var _B = filter(_A,[3M]=3)
return
COUNTROWS(_B)

 

then you can use that in the conditional formatting of your visual.

 

output:

VahidDM_0-1644964096932.png

 

 

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.