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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aguuzdo
Helper I
Helper I

Creating filter column that puts a flag en every record if there were 4 consecutive same categories

Hello everyone, I'm trying to create a calculated column in a table to then use it as a filter in a report.

I have two posible categories "A" and "B", I need to put a yes in the calculated column if I have four consecutive A´s for the same name (in each of the rows with the consecutive A's, furthermore, if there are more than 4 consecutive A's, this rows should also get yes as a result. 

 

Following a table example with the column flag showing the expected result for this calculated column:

datenamecategoryflag
01-01-23OscarAyes
02-01-23OscarAyes
03-01-23OscarAyes
04-01-23OscarAyes
05-01-23OscarAyes
01-01-23JuanBno
02-01-23JuanBno
03-01-23JuanBno
04-01-23JuanAno
05-01-23JuanBno
01-01-23BryanBno
02-01-23BryanBno
03-01-23BryanBno
04-01-23BryanBno
05-01-23BryanAyes
06-01-23BryanAyes
07-01-23BryanAyes
08-01-23BryanAyes
01-01-23JessicaAno
02-01-23JessicaAno
03-01-23JessicaBno
04-01-23JessicaAyes
05-01-23JessicaAyes
06-01-23JessicaAyes
07-01-23JessicaAyes

 

Thanks very much in advance.

2 REPLIES 2
johnyip
Super User
Super User

Do you need to have this calculated column do the calculation based on the row order of your raw data, or the order the records are displayed in a table/matrix vis?



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

hi, the order of the records is based on the date column

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.