Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
2 years ago
Solved

Group columns into a category

Good afternoon, in my table in power bi I have separated the columns of gender and age range, that is to say that in one column I have Women and in another Men, in another column for example, adults, babies, children etc, in the records is the amount of each attribute. I need to group for example the gender in something that says "gender" and be able to filter if I want male or female, and the same with age range, then I can analyze for example what is the predominant age range of women etc.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Syndicate_Admin 

     

    Please try this:

    Here I create a set of sample:

    Then in Power Query, select the columns except for scope and gender.

    Click the Unpivot columns in the Transform pane:

    The result is as follow:

     

    Best Regards

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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin 

     

    Please try this:

    Here I create a set of sample:

    Then in Power Query, select the columns except for scope and gender.

    Click the Unpivot columns in the Transform pane:

    The result is as follow:

     

    Best Regards

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