Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi,
I am trying to select values from a list where my bolean (true/false) list would indicate to select the column.
Something like.
List.Select(datalist, listwithtruefalsevalues)
Quite common in R and other languages, you select rows from you dataframe based on an array of true/false values.
Hope its clear.
Kind regards, Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Solved! Go to Solution.
See if this help
let
DataList= {1,2,3,4,5},
Listwithtruefalse = {true,false,true,true,false},
Mergedlist=List.Zip({DataList,Listwithtruefalse }),
Desiredlist = List.Transform(
List.Select(Mergedlist, (d)=>d{1}=true),(d)=>d{0})
in
Desiredlist
since you have 2 lists of the same lengths, why not use subscript to pick up responding values like this,
let
DataList= {1,2,3,4,5},
Listwithtruefalse = {true,false,true,true,false},
Desiredlist = List.Accumulate({0..List.Count(Listwithtruefalse)-1}, {}, (s,c)=>if Listwithtruefalse{c} then s&{DataList{c}} else s)
in
Desiredlist
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
See if this help
let
DataList= {1,2,3,4,5},
Listwithtruefalse = {true,false,true,true,false},
Mergedlist=List.Zip({DataList,Listwithtruefalse }),
Desiredlist = List.Transform(
List.Select(Mergedlist, (d)=>d{1}=true),(d)=>d{0})
in
Desiredlist
Thanks, I found a way to do it, turns out, it's the same approach as you suggest. So it probably makes sense 😃
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
since you have 2 lists of the same lengths, why not use subscript to pick up responding values like this,
let
DataList= {1,2,3,4,5},
Listwithtruefalse = {true,false,true,true,false},
Desiredlist = List.Accumulate({0..List.Count(Listwithtruefalse)-1}, {}, (s,c)=>if Listwithtruefalse{c} then s&{DataList{c}} else s)
in
Desiredlist
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 5 | |
| 4 | |
| 4 |