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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
koorosh
Post Partisan
Post Partisan

Read check marks

Hello All,

I have a data source like the following:

koorosh_0-1706211108314.png

How I can get the following report?

koorosh_1-1706211150499.png

 

3 ACCEPTED SOLUTIONS

so you can understand what the code does, I've broken it down into several parts

Screenshot_2.png

// 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, ", ")

View solution in original post

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 result 

 

 

you 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! 🤠

View solution in original post

19 REPLIES 19
Ahmedx
Super User
Super User

pls try this

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUYoAYiiK1YlWcoKwK5CEnOEqKmBCLghNIFGQkCuSLpCqWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Users = _t, #"Full Control" = _t, Design = _t, Read = _t, #"View Only" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Users", type text}, {"Full Control", type text}, {"Design", type text}, {"Read", type text}, {"View Only", type text}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Users"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] <> "")),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Value"})
in
    #"Removed Columns"

 

Thanks, Ahmad but what about when a user has multiple access? Like following image:

koorosh_0-1706332530114.png

Please consider that is an example, in real there are many users.

 

or try this

Screenshot_1.png

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

Screenshot_2.png

// 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, ", ")

koorosh_0-1706367313375.png

 

you have incorrectly specified the name of the previous step here

Screenshot_1.png

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?

pls try this

Screenshot_2.png

pls try this

 

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]

pls rty this

 

Daniel29195
Super User
Super User

@koorosh 

 

did you try unpivoting the table  and then remove the rows where value  = blank ? 

Daniel29195_0-1706305238258.png

 

Daniel29195_1-1706305262806.png

 

 

STEP 1 : SELECT the column user

 

step2 :  click unpivot other columns 

Daniel29195_2-1706305297357.png

 

 

step3 : filter out blank values /

Daniel29195_3-1706305309393.png

 

 

result : 

Daniel29195_4-1706305327104.png

 

 

you can then remove the column value if you want .

 

 

 

 

 

If my answer helped sort things out for you, feel free to give it 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! 👍🤠

 

 

Thanks Daniel, but what about when a user has multiple access, like the following image?

 

koorosh_1-1706332633094.png

Please consider that is an example, in real there are many users.

@koorosh 

Daniel29195_0-1706342242012.png

Daniel29195_1-1706342267789.png

 

isnt this what you would like to have ?  or am i missing something ? 

 

if you want to merge them into one row,  then you can use DAX function concatenatex  

 

 

 

 

 

 

Daniel, Please let me know how to concatenate attributes for each user.

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 result 

 

 

you 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! 🤠

ThxAlot
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUYoAYiiK1YlWcoKwK5CEnOEqKmBCLghNIFGQkCtUvgIuGAsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Users = _t, #"Full Control" = _t, Design = _t, Read = _t, #"View Only" = _t]),
    #"Combined Columns" =
    let colNames = List.Skip(Table.ColumnNames(Source))
    in
        Table.CombineColumns(Source, colNames, each Text.Combine(List.Accumulate(List.PositionOf(_,"",Occurrence.All,(x,y) => x<>y), {}, (s,c) => s & {colNames{c}}), ", "), "Access")
in
    #"Combined Columns"

ThxAlot_0-1706213620121.png

 

For fun only, a showcase of powerful Excel formulas,

ThxAlot_1-1706213708192.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



I got the following?

koorosh_0-1706304196011.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors