cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Heidi Regular Visitor
Regular Visitor

A newbie question about combining information from different columns

Hi! 

 

I have a data sheet that has three columns from which I want to combine data from. Here's an example. 

 

Column1        Column2       Column3

Topic 1           Topic 2          Topic 3

Loneliness      Depression   

Friendship      Abuse            Loneliness

Depression     Friendship

 

I would like to make a chart that shows in visual form how many times different answers appear in the data, like

 

Depression 2

Friendship 2

Loneliness 2

Abuse 1

 

I have done this in Excel with CountIfs function, but haven't been able to figure out how to most effectively do it in Power BI.  

 

Kind regards, 

Heidi 

1 ACCEPTED SOLUTION

Accepted Solutions
moumipanja Regular Visitor
Regular Visitor

Re: A newbie question about combining information from different columns

Hi @Heidi

 

1. Go to Edit Queries -> Select all 3 columns and right click on it -> Unpivot columns -> Close & Apply

2. You have 2 columns in your table now, Attribute & Value. Create a Measure like below and you will get the result.

Measure = COUNTA(Table[Value])

If this answers to your query, please mark this as a solution.

View solution in original post

4 REPLIES 4
moumipanja Regular Visitor
Regular Visitor

Re: A newbie question about combining information from different columns

Hi @Heidi

 

1. Go to Edit Queries -> Select all 3 columns and right click on it -> Unpivot columns -> Close & Apply

2. You have 2 columns in your table now, Attribute & Value. Create a Measure like below and you will get the result.

Measure = COUNTA(Table[Value])

If this answers to your query, please mark this as a solution.

View solution in original post

Heidi Regular Visitor
Regular Visitor

Re: A newbie question about combining information from different columns

Thank you so much for taking the time to help me out, works perfectly! 

 

Can I ask why is the measure needed? The solution seems to work even without it? 

 

With kind regards, 

Heidi 

moumipanja Regular Visitor
Regular Visitor

Re: A newbie question about combining information from different columns

There are several ways to get a particular answer and you are right, the above solution will work without a measure in this case. However. once your data grows and becomes complex in nature, Measures help you perform dynamic calculations in a much better way while interacting with your reports.

Highlighted
Heidi Regular Visitor
Regular Visitor

Re: A newbie question about combining information from different columns

Thank you very much moumipanja for helpling me out, I really appreciate it. I will definately look into measures and try to get a hold of them. At the moment everything is still a bit overwhelming with so much to learn! 🙂 

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors