Forum Discussion
Read check marks
- 2 years ago
or try this
- 2 years ago
so you can understand what the code does, I've broken it down into several parts
// Extract field values from the record t1 = Record.FieldValues(_), // Convert the field values to lowercase t2 = List.Transform(t1, Text.Lower), // Find positions of occurrences of the letter "x" in lowercase t3 = List.PositionOf(t2, "x", Occurrence.All), // Retrieve column names based on positions t4 = List.Transform(t3, (x) => Table.ColumnNames(#"Changed Type"){x}), // Combine the retrieved column names into a comma-separated text t5 = Text.Combine(t4, ", ") - 2 years ago
Hello koorosh
create a calculated column as follow ;
cc = var datasource = calculatetable ( tbl_name, allexcept(tbl_name,tbl_name[access]) ) var result = concatenatex ( datasource , tbl_name[attribute_col_name], " , " ) return resultyou can use the same logic ( with some minor modification ) and create it as a measure ,
it would be flexible and will be dynamically modified base on your slicers and filters existing on the page .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅!
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
If you find time please explain the above code.
so you can understand what the code does, I've broken it down into several parts
// Extract field values from the record
t1 = Record.FieldValues(_),
// Convert the field values to lowercase
t2 = List.Transform(t1, Text.Lower),
// Find positions of occurrences of the letter "x" in lowercase
t3 = List.PositionOf(t2, "x", Occurrence.All),
// Retrieve column names based on positions
t4 = List.Transform(t3, (x) => Table.ColumnNames(#"Changed Type"){x}),
// Combine the retrieved column names into a comma-separated text
t5 = Text.Combine(t4, ", ")- koorosh2 years agoPost Partisan
- Ahmedx2 years agoSuper User
you have incorrectly specified the name of the previous step here
- koorosh2 years agoPost Partisan
Thank you very much Ahmad. As you know I am curious and many questions have in my mind.
Could you please let me know the equivalent DAX formula for the above code?
- Ahmedx2 years agoSuper User
pls try this
- Ahmedx2 years agoSuper User
or try this
[ t1 = Record.FieldValues(_), t2 = List.Transform(t1, Text.Lower), t3 = List.PositionOf( t2,"x" ,Occurrence.All), t4 = List.Transform(t3,(x)=> Table.ColumnNames (#"Changed Type"){x}), t5= List.Select(t4, (x)=> List.ContainsAny({"Full Control","Design","Read","View Only"},{x})), t6 = Text.Combine(t5,", ")] [t6]