Forum Discussion

mwhite's avatar
mwhite
New Member
5 years ago
Solved

How do i count values from three different columns and show this on a tree map?

I have 3 columns (sent 1, sent 2 and sent 3) which each has the name of the company that a document was sent to. I'm trying to get power bi to count the total number of times that a name comes up in each of these columns, but right now it is showing how many times the shows up in the first column and then adding however many cells are filled in the row after it.

 

For example, let's say I had document 1 sent to 'tree' in the sent 1 column and document 2 sent to 'tree' in the sent 1 column and sent to 'branch' in the sent two column. Right now PBI is showing a total of three for tree, instead of two for tree and one for branch.

 

Does anyone have any solutions?

  • When you load data (in power query), there is an unpivot feature. Before you will have

     

    column 1, column 2, sent 1, sent 2, sent 3

     

    after unpivoting you will have

     

    column 1, column 2, attribute, value

     

    attribute will contain the values 

    sent 1

    sent 2

    sent 3

     

    the value column tells you where each were sent. 

    this is a better shape to do what you want. 

1 Reply

  • MattAllington's avatar
    MattAllington
    Icon for Community Champion rankCommunity Champion

    When you load data (in power query), there is an unpivot feature. Before you will have

     

    column 1, column 2, sent 1, sent 2, sent 3

     

    after unpivoting you will have

     

    column 1, column 2, attribute, value

     

    attribute will contain the values 

    sent 1

    sent 2

    sent 3

     

    the value column tells you where each were sent. 

    this is a better shape to do what you want.