Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Column1 | Custom |
Name | FALSE |
Date | FALSE |
Assignment | FALSE |
Leader | FALSE |
Assistant | FALSE |
FALSE | |
FALSE | |
FALSE | |
Task | TRUE |
A | TRUE |
B | TRUE |
C | TRUE |
D | TRUE |
E | TRUE |
F | TRUE |
Additional Resources | TRUE |
Results | TRUE |
TRUE | |
Notes | TRUE |
FALSE | |
FALSE | |
Feedback | FALSE |
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
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |