Forum Discussion

misc's avatar
misc
New Member
1 year ago
Solved

Report values from delimited multiple choice column with connections across visualisations

I have a multiple choice data column which I would like to present in my report as a matrix table which shows the % of respondents who chose those options.

 

I followed some intructions from another thread on how to split out the responses by delimitor, unpivot, group by Value/Attribute and then feed that into the table visualiser. This provides me with an outcome looking like this: 

However, because this pulls the data out into another query it loses its connection to the other data on the page e.g. if I select data in another visualiser it will not be able to work out the connection between the two - the table is always reporting on 100% of the overall data, rather than just the reduced data set.

 

I have a 'response ID' column in my main data set, and I think I need to somehow align this column's data with the split/deliminated column responses in order for them to read the data correctly, but I cannot figure out how to do this.

 

Any advice will be much appreciated. I am entirely new to powerBI and have muddled through up to this point! Thank you!

 

  • misc's avatar
    misc
    1 year ago

    Hi all,

     

    Thanks for your help. With a bit more work on this today I figured out what I needed and turns out had (probably unsurprisingly) over complicated it in the first place. 

     

    This is the solution I ended up with,

    Where I had selected the columns I wanted to keep (Response ID, plus the relevant multi choice column) before the 'Unpivot other columns' actions,

    Removed the Attribute and Value created during the unpivot

    Remove duplicates from Response ID

    Split multi choice by delimiter 

     

    The Value of my visualisations is then the Count of Response ID and this means the drill throughs work as expected/hoped.

4 Replies

  • dk_dk's avatar
    dk_dk
    Icon for Super User rankSuper User

    Hi misc 

    Hard to say exactly without seeing the raw data and the transformations you did to it, but assuming you have 

    Original table
    - id column

    - value column (delimited, unpivoted, but before the groupby step)

     

    Grouped table
    - value column grouped

     

     

    Then you would need to make sure there is a many to one relationship on the Value column between the two tables.


    If you need further help, please provide a sample of your original data, as well as the M code for the transformation steps you already applied.

    If possible, provide sample data in a copyable tabluar format.

    Best regards,
    Daniel

    • misc's avatar
      misc
      New Member

      Thanks for the quick response. Couldn't figure out if there's a way for me to attach a document so have copied some example data below. This is a (much reduced) version of my original data set (named "R&R").

      Response IDDEMONSTRATED TECHNICAL SKILLSHave you received training/development to support your demonstrating to any of these groups?TAUGHT TECHNICAL SKILLSHave you received training/development to support you in your teaching activities?
      R_2X821tVgJAzyoudTechnicians,Apprentice/Trainees,Staff,External VisitorsYesN/A 
      R_2RWkUkiQpJKASA1N/A N/A 
      R_8m4E5qmxE7eBAaOTechnicians,StaffNoTechnicians,StaffNo
      R_27JeEpoQrqGpI8zAcademics,Technicians,StaffNoN/A 
      R_8zSP90zrct7YkjTMasters,PhD,Academics,Technicians,StaffYesN/A 
      R_2M7ABggiFYy7l2pUG,Masters,PhD,Academics,Technicians,Staff,External VisitorsNoN/A 
      R_8xBoDKtw3MwDWO5N/A N/A 
      R_8kH8h7Vg3XDLYNTUG,Masters,PhD,Academics,TechniciansYesN/A 
      R_8amACJTZ3yj8ds9N/A N/A 
      R_2c7xJyXcetFxgL0N/A N/A 
      R_2oSnwPflWtgWYnpN/A N/A 
      R_2C7KH1ym53cZUPoUG,Masters,PhD,Technicians,Apprentice/Trainees,Staff,External VisitorsYesN/A 
      R_88T0idiRgjf8aH3Technicians,StaffNoN/A 
      R_8iqXnsTBHlaG7pOUG,Masters,PhD,Academics,Technicians,Staff,External VisitorsNoUG,Masters,Academics,Technicians,Staff,External VisitorsNo
      R_2drRwtihFvZYkjeStaffNoStaffNo
      R_2PWWrYQBPgsZcecUG,Masters,PhD,Academics,TechniciansYesN/A 
      R_2HiFcGTh1epMleWMasters,PhD,Academics,Technicians,Apprentice/Trainees,External VisitorsYesN/A 
      R_8jdOFsGnKQR1YH9Academics,Technicians,StaffNoAcademics,Technicians,Apprentice/Trainees,StaffNo
      R_2GnebpRleVqszGVAcademics,Technicians,StaffYesN/A 
      R_8EGMwr7OVDXLw7MN/A PhD,Academics,Technicians,Apprentice/Trainees,StaffNo
      R_238qzGRRS40Swk7Masters,Academics,Technicians,Staff,External VisitorsYesN/A 
      R_8U8bXLZA0mcGEhzN/A N/A 
      R_8iqegWHm5dVldgIUG,Masters,PhD,Academics,Technicians,StaffNoN/A 
      R_8JKeIfGJkgBxEd3N/A N/A 
      R_2Ei2GHmpYCXIj59UG,Masters,PhD,Academics,Technicians,Staff,External VisitorsNoAcademics,Technicians,StaffNo
      R_2zdZcX7rQHMIVgdTechniciansNoN/A 
      R_8p4jHON6VsSQFGSAcademics,Technicians,Staff,External VisitorsNoTechniciansYes
      R_25S1oatthrp3PxyTechniciansNoTechnicians,StaffNo
      R_2HivcNhVB13MVljUG,Masters,PhD,Academics,Technicians,Apprentice/Trainees,Staff,External VisitorsNoUG,Masters,PhD,Academics,Technicians,Apprentice/Trainees,Staff,External VisitorsNo
      R_2uJtzBQp43noRR4Technicians,Staff,External VisitorsNoN/A 
      R_20C4m9CmpiOYpE9Apprentice/Trainees,StaffNoN/A 
      R_2IF8WhJtwRiAsITUG,Masters,PhD,Academics,Technicians,Apprentice/Trainees,Staff,External VisitorsNoUG,PhD,Technicians,Apprentice/Trainees,StaffYes
      R_2HOt4QhLwFAmuFXN/A N/A 
      R_8yhzCkATFQ3hRsdAcademics,Technicians,StaffNoAcademics,Technicians,StaffNo
      R_8b1NkaItbD3T2MhUG,Masters,PhD,Academics,Technicians,Staff,External VisitorsYesUG,Masters,PhD,Academics,Technicians,Staff,External VisitorsNo
      R_8Cg69QuYTTyYVmVPhD,Academics,Technicians,Apprentice/TraineesNoTechnicians,Apprentice/TraineesNo
      R_80SX2HlEIDB5NC0N/A N/A 
      R_23sfPUMIC1x7GexUG,Technicians,Apprentice/Trainees,External VisitorsNoTechniciansNo
      R_8K7mX3oKMqLqcWUTechniciansYesN/A 
      R_8EhWAXg3ByO7EXjN/A N/A 
      R_8kCiIbWVNDsZToJN/A N/A 
      R_8o7LoUzM6Dysg2QStaffNoN/A 
      R_2nD99sXnhLNwq5ON/A N/A 
      R_2C8a5V4LwtNwi4kTechnicians,StaffNoTechnicians,StaffNo
      R_2dz3qQntH1QxY18N/A N/A 
      R_88ERQXTZG18Jx8BStaffNoStaffNo
      R_81GCzqnCxVVXLhuStaffNoN/A 
      R_2OjeGWJ0A7s8v1TUG,Masters,PhD,Academics,Technicians,Apprentice/Trainees,Staff,External VisitorsYesUG,Masters,PhD,Technicians,Apprentice/Trainees,External VisitorsYes
      R_2rdXsFfVpQZUKRQAcademics,StaffNoTechnicians,StaffNo

       

      I cannot find the thread I followed the other day to get me to where I currently am but the steps I followed were:

      1) Create duplicate data set (right click and 'duplicate' within 'Transform')

      2) Split column by deliminator (comma, split to columns)

      3) Highlight all split columns and choose 'unpivot columns'

      4) Highlight Attribute and Value columns and 'Group By' and this ends up with the data set looking like:

      To visualise this I add the Value to the Row of the table visualiser, and the Count (%) to the Value.

       

      From what you say in your original message, does this mean that I shouldn't have duplicated the data set as the first step? 

      If I Group By it removes all the other columns under that data set - how do I Group By into a separate query?

      I'm also not sure I understand how to establish a many to one relationship between the sets. Apologies, as I said I am very new to PowerBI so lots of terms I'm unfamiliar with.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi misc ,

    Based on the description, try creating a relationship between two tables using Response ID.

    Then, using the following DAX formula.

    GT sum of count = 
    VAR _selection = COUNTROWS('Table (2)')
    RETURN
         DIVIDE(
             CALCULATE(_selection, ALL('Table')),
             COUNTROWS('Table'),
             0
         )

     

    Best Regards,

    Wisdom Wu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • misc's avatar
      misc
      New Member

      Hi all,

       

      Thanks for your help. With a bit more work on this today I figured out what I needed and turns out had (probably unsurprisingly) over complicated it in the first place. 

       

      This is the solution I ended up with,

      Where I had selected the columns I wanted to keep (Response ID, plus the relevant multi choice column) before the 'Unpivot other columns' actions,

      Removed the Attribute and Value created during the unpivot

      Remove duplicates from Response ID

      Split multi choice by delimiter 

       

      The Value of my visualisations is then the Count of Response ID and this means the drill throughs work as expected/hoped.