Forum Discussion

xieofxie's avatar
xieofxie
Frequent Visitor
7 years ago

pie chart on list

I have some data as following

 

textlist
blaha,b
blahb
blaha,c

 

How could I use pie chart to show the distribution of a,b,c?

 

Thanks in advance~

4 Replies

  • Ani1991's avatar
    Ani1991
    Icon for Resolver III rankResolver III

    Hi xieofxie,

     

    I am afraid if I understood your question correctly.
    From what I understood, you need to show the the count of a,b,c in a Pie chart. Correct me if I am wrong.

    Here's what I tried,

    I created a sample data based on your inputs for the same.

    Then go to Edit queries and perform the following steps,

    1. Select the column list and Split using comma(,) as delimeter.

    2. Then select the Splitted columns and go to Transform at the top of the ribbon and select Unpivot columns (only selected columns).

    3. You would get something like below

    4. Click on Close and Apply.

    5. Now pull the value column uder the Legend and Value fields of Pie Chart and you would get something like below where the numbers are the count of a,b and c. You can also do it with Text column.

    Hope this helps!!

    If not, then please elloborate on the distribution of a,b,c and some more sample data.

     

    Thanks,

    Ani

    • xieofxie's avatar
      xieofxie
      Frequent Visitor

      Ani1991  Thanks~ Yes, you understand correctly. But if I split for more rows, some other chart based on rows might break. Imagine this:

       

      user question (text)user tags (list)user rate (number)
      blah1a,b10
      blah2b9
      blah3a,c8

       

      Another pie chart for user rate would break. I use python now and I am just wondering how to do this natively in PowerBI..

      • Ani1991's avatar
        Ani1991
        Icon for Resolver III rankResolver III

        Hi xieofxie 
        I again took help of the sample data you provided and followed the same steps as earlier. 

        Still I am able to get the correct output for User_rate as well. Selected average instead of sum. We would be required to take care that we select the correct aggregation since we are unpivoting the data.

        Hope this helps!!

        Thanks,

        Ani