Forum Discussion
Create Clustered column Chart
- 6 years ago
Hi kodnil2020 ,
We can create a column and a matrix table to meet your requirement.
1. Create a calculate column to sort Grade.
Legend = SWITCH( TRUE(), CONTAINSSTRING('Table 1'[Grade],"A"),"A", CONTAINSSTRING('Table 1'[Grade],"B"),"B", CONTAINSSTRING('Table 1'[Grade],"C"),"C","D & Above")Then we can create a measure and put the column to legend in Clustered Column Chart.
Measure = var _x = CALCULATE(DISTINCTCOUNT('Table 1'[ID]),FILTER('Table 2','Table 2'[Active]=1)) var _y = CALCULATE(DISTINCTCOUNT('Table 1'[ID]),FILTER(ALLSELECTED('Table 2'),'Table 2'[Active]=1),FILTER(ALLSELECTED('Table 1'),'Table 1'[Department]=MAX('Table 1'[Department]))) return DIVIDE(_x,_y)If you have any question, please kindly ask here and we will try to resolve it.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
kodnil2020 - Assuming that your tables are related on ID, you should just have to add Active column to your Filters pane and set it to 1.
And, welcome to the community. Check out this article here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
And you did really well on that front! 🙂