Forum Discussion

annetoal's avatar
annetoal
Icon for Helper II rankHelper II
6 years ago
Solved

Using SELECTCOLUMNS to build a table

I have a large table that has 10 columns containing raw data I want to summarize using COUNTA and put the results into a new table. The Columns all have the same prefix, hoping that some kind of wild...
  • edhans's avatar
    edhans
    6 years ago

    annetoal - go back and look at what mahoneypat did. It seems to be to be 100% UI driven, so pretty easy to implement. The steps in summary:

    1. Select the columns you want to keep, then select Remove Other Coluimns from the Home Menu.
    2. Select the Response column, then on the Transform ribbon, Unpivot Other Columns
    3. For the Attribute column, (which has your old column names) extract all text between the "a " and "?" chars. Keep that and get rid of the other text.
    4. Right-click on the Attribute column and transform to Proper Case.
    5. Rename the Attribute column to Question and Value to Answer.

    See these directions for implementing this code in your model, getting rid of the sample source step and replacing with yours. You really should try this. This is basic Power Query, not advanced, and can be very useful. Use DAX for your analysis, but Power Query for your modeling and data transformation.

     

     

    1) In Power Query, select New Source, then Blank Query
    2) On the Home ribbon, select "Advanced Editor" button
    3) Remove everything you see, then paste the M code I've given you in that box.
    4) Press Done
    5) See this article if you need help using this M code in your model.

  • v-kelly-msft's avatar
    v-kelly-msft
    6 years ago

    Hi annetoal ,

     

    So your issue is solved,right?

    Could you pls mark the reply as answered to close it?

    Much appreciated.

     

    Best Regards,
    Kelly
    Did I answer your question? Mark my post as a solution!