Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello Community,
I am facing difficulity with the following scenario
There is a table distributors with columns Name, Gender and Amount
Another table collector, which contains a measure with count of collectors(no of collectors)
Here I need a chart which shows the gender wise breakdown of avg amount per collector
(A bar chart with X- axis -- Gender and Y-axis Avg amount per collector)
I would be thankful for your suggestions.
Hi
Please provide a sample PBI file which contains your data and data model.
Hi @manish_g,
To create the chart that shows the gender-wise breakdown of average amount per collector, I think you could follow these steps:
First, you need to create a relationship between the Distributors and Collectors table. To do this, go to the "Modeling" tab and click on "Manage Relationships." Then, create a relationship between the "Name" column in the Distributors table and the "Collector" column in the Collectors table.
Next, create a measure to calculate the average amount per collector. You can do this by going to the "Modeling" tab and clicking on "New Measure." Use the following formula:
Avg Amount per Collector = SUM(Distributors[Amount])/COUNT(Collectors)
Now, create a new table by going to the "Modeling" tab and clicking on "New Table." In the formula bar, enter the following formula:
Gender Breakdown = DISTINCT(Distributors[Gender])
Create another measure to calculate the average amount per collector by gender. Use the following formula:
Avg Amount per Collector by Gender = AVERAGEX( FILTER(Distributors, COUNTROWS(FILTER(Collectors, Collectors[Gender] = Distributors[Gender])) > 0), [Avg Amount per Collector])
This formula filters the Distributors table to only include those with collectors of the same gender, and then calculates the average amount per collector using the previously created measure.
Finally, create a bar chart by dragging the "Gender" column from the Gender Breakdown table to the X-axis and the "Avg Amount per Collector by Gender" measure to the Y-axis.
That should give you a chart that shows the gender-wise breakdown of average amount per collector.
Let me know if it works or if you need any additional help.
Best regards,
Isaac Chavarria
If this post helps, then please consider Accepting it as the solution and giving Kudos to help the other members find it more quickly
In point no 4 you have used this Collectors[Gender], but there is no Gender in Collectors.
Collectors aren't connected to distributors table. Clooector only contains Name, Id and address.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
10 |