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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
anna-lee
Helper I
Helper I

Fill between conditional column

Hi,

I have multiple data sets where the ranges differ between the rows I want to filter for. I'd like to add a custom column where it will populate "True" between the instance "Task" and "Notes" in Column1. Is this possible? Example below for what I am aiming as a result. 

Column1Custom
NameFALSE
DateFALSE
AssignmentFALSE
LeaderFALSE
AssistantFALSE
 FALSE
 FALSE
 FALSE
TaskTRUE
ATRUE
BTRUE
CTRUE
DTRUE
ETRUE
FTRUE
Additional ResourcesTRUE
ResultsTRUE
 TRUE
NotesTRUE
 FALSE
 FALSE
FeedbackFALSE
2 REPLIES 2
Anonymous
Not applicable

I would add a column named Column2 like 

 

...each if [Column1] = "Task" then "TRUE" else if [Column1] = "Notes" then "FALSE" else null)

 

Then FillDown, then your final column is

 

...each if [Column1] = "Notes" then "TRUE" else [Column2])

 

--Nate

jgordon11
Resolver II
Resolver II

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText(
        "ZY3BCoQwEEN/RXren9BdPYkH2VvxMNogRW3BGf/fMhURvDwSEhJrTUcbzPCx5keSRcns57AhiNoW5LDfCQtdQfHin3jJRWWl/OZ1Za1scsc5Lz4GWoseHI99AmuQ3LEKP3a7KODXWwO4kab0OJw=", 
        BinaryEncoding.Base64), Compression.Deflate))),
    lst = List.Accumulate(Source[Column1], {{false,false}}, (s,c)=>
            if c = "Task" then s & {{true,false}} else   
            if c = "Notes" then s & {{true,true}} else
            if List.Last(s) = {true,false} then s & {{true, false}} else  
                s & {{false,false}}
    ),
    lst1 = List.Skip(List.Zip(lst){0}),
    Result = Table.FromColumns(Table.ToColumns(Source) & {lst1}, Table.ColumnNames(Source) & {"Custom"})
in
    Result

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.