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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
ATHULVADAKKATH
New Member

Power BI dashboard

Dear Team,

 

I want to create a Power BI dashboard based on the customer response regarding for potatoo chips. 

i have one code book and response sheet. 

How I need to establish the relationship between the files and what are the steps I have to follow.

 

thank you

 

code book

ATHULVADAKKATH_0-1661335508356.png

Response sheet

ATHULVADAKKATH_1-1661335545995.png

VariableAttributeTypeQuestion/AnswerCode 
      
Q111QuestionCodedselectAge  
   0-180 
   18-351 
   35-502 
   51 or Older3 
Q112QuestionCodedselectHave you see the add before Aided Brand Awareness
Q112.1QuestionCodedselectBrand 1 0 
   I Have Heard Of1 
   I Have Not Heard Of2 
   Not Sure  
Q112.2QuestionCodedselectBrand 2   
   I Have Heard Of0 
   I Have Not Heard Of1 
   Not Sure2 
Q112.3QuestionCodedselectBrand 3  
   I Have Heard Of0 
   I Have Not Heard Of1 
   Not Sure2 
IDQ111Q112.1Q112.2Q112.3 
00220 
21110 
42110 
63220 
83110 
102110 
151220 
190110 
201220 
222110 
303220 
320220 
351222 
362110 
373110 
383110 
402220 
410220 
441110 
452220 
483112 
523220 
532110 
561220 
1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @ATHULVADAKKATH ,

 

First for the Response table, unpivot these variable columns.

 

vkkfmsft_1-1661750715546.png

 

For the code book table, use the following code to transform.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("vZE9C8IwEIb/ytHZSpMQ6KoudbEUx9IhmqsKpYE0Ffz3Jn61NDVuDuFy3BvueUhZRhAtJqdalFFBCLFN0WNnLqq1142SKDts8GhstzrhJzt+ncQkdcUbkDRm3FVvwnjME1upN+EElIa8kahd7g1GQ2CZuCLcVA8dIpgzgpASDlgrjWM5ugzqrbVoJRCYVdnCY0mGQkvI61mpV2anzDjnK7rAvp+yBQ2fbHT4qzDbV/4Jm+8wYqMDG/vNxv6MVt0B", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Variable = _t, Attribute = _t, Type = _t, #"Question/Answer" = _t, Code = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Variable", type text}, {"Attribute", type text}, {"Type", type text}, {"Question/Answer", type text}, {"Code", Int64.Type}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Attribute", "Type"}),
    #"Replaced Value" = Table.ReplaceValue(#"Removed Columns"," ",null,Replacer.ReplaceValue,{"Variable"}),
    #"Filled Down" = Table.FillDown(#"Replaced Value",{"Variable"}),
    #"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Variable] <> null))
in
    #"Filtered Rows"

vkkfmsft_2-1661750745409.png


Then, merge the two tables.

 

vkkfmsft_0-1661750640114.png

vkkfmsft_3-1661750759839.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

1 REPLY 1
v-kkf-msft
Community Support
Community Support

Hi @ATHULVADAKKATH ,

 

First for the Response table, unpivot these variable columns.

 

vkkfmsft_1-1661750715546.png

 

For the code book table, use the following code to transform.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("vZE9C8IwEIb/ytHZSpMQ6KoudbEUx9IhmqsKpYE0Ffz3Jn61NDVuDuFy3BvueUhZRhAtJqdalFFBCLFN0WNnLqq1142SKDts8GhstzrhJzt+ncQkdcUbkDRm3FVvwnjME1upN+EElIa8kahd7g1GQ2CZuCLcVA8dIpgzgpASDlgrjWM5ugzqrbVoJRCYVdnCY0mGQkvI61mpV2anzDjnK7rAvp+yBQ2fbHT4qzDbV/4Jm+8wYqMDG/vNxv6MVt0B", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Variable = _t, Attribute = _t, Type = _t, #"Question/Answer" = _t, Code = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Variable", type text}, {"Attribute", type text}, {"Type", type text}, {"Question/Answer", type text}, {"Code", Int64.Type}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Attribute", "Type"}),
    #"Replaced Value" = Table.ReplaceValue(#"Removed Columns"," ",null,Replacer.ReplaceValue,{"Variable"}),
    #"Filled Down" = Table.FillDown(#"Replaced Value",{"Variable"}),
    #"Filtered Rows" = Table.SelectRows(#"Filled Down", each ([Variable] <> null))
in
    #"Filtered Rows"

vkkfmsft_2-1661750745409.png


Then, merge the two tables.

 

vkkfmsft_0-1661750640114.png

vkkfmsft_3-1661750759839.png


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors