cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CLQ
Helper I
Helper I

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.

CLQ_1-1664380491090.png
-->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:

 

CLQ_2-1664380949454.png

 

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 4
VijayP
Super User
Super User

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




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


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 

VijayP
Super User
Super User

@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




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


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?

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power BI Dev Camp Session 27

Ted's Dev Camp

This session walks through creating a new Azure AD B2C tenant and configuring it with user flows and custom policies.