Forum Discussion

CLQ's avatar
CLQ
Helper I
3 years ago

Problem displaying data in a bar chart

Hi! I am having a problem: I have several columns (reason1/2/3/4) where there can be 4 different values, in text format:
-Cold Food
-Smashed Food
-Rude Delivery
-Other

And each row represents a different order.
Not necessarily all the "reason" columns will have data.


-->Count: 3 "Colld Food"; 4 "Rude Delivery"; 4 "Other"; 5 "Smashed Food"

So, I want to count how many of each "complaint" exist, that is, that in PBI I want something like this:

 

 

My problem is that my idea is based on using "count", when adding it the numbers are wrong, that is, if I have two columns with data in a row, both are added. Example:

I only have two orders with a "Cold Food" complaint, but one of those orders also has "Rude Delivery", instead of showing a 2, I get a three because what i do is similar to: 
CountOrder = count('Table'[Reason1])+count('Table'[Reason2])+ ......

Any help is welcome. Thank you

 

 

 

4 Replies

  • VijayP's avatar
    VijayP
    Community Champion

    CLQ 

    In power query editor unpivot all reason columns and bring them into single column

    Then try to use that in visual to get the requried visual

    • CLQ's avatar
      CLQ
      Helper I

      I'm sorry, I didn't understand: if I have all the data in a single column, how would PBI recognize the four different texts and then count each one so that it looks like the graph I posted?

  • VijayP's avatar
    VijayP
    Community Champion

    CLQ for each value the reason is also will be in another column and whihc can be used as a parameter or slicer

    • CLQ's avatar
      CLQ
      Helper I

      Oh, I think I understood. The problem is that my file is not the dataset, but it has a dynamic connection so I can't use PQ