Forum Discussion
How I mix two graphs
There are no perfect solutions for this, but I can give you 2 workarounds:-
I - Create clustered column chart
1) Create the below 3 measures (change table names appropriately)
MalePct = CALCULATE(SUM('Fact'[Pct]), 'Fact'[Gender]="Male")
FemalePct = CALCULATE(SUM('Fact'[Pct]), 'Fact'[Gender]="Female")
AllPct = CALCULATE(SUM('Fact'[Pct]), 'Fact'[Gender]="Male" || 'Fact'[Gender]="Female")
2) Create clustered column chart with just these 3 measures. You will get all three bars but they will not have the spacing.
II - Create disconnected table
1) Create a disconnected table GenderAll with 3 values for Gender - Male, Female, All
2) Now create a measure
PctWithAll = SUMX(VALUES(GenderAll[Gender]), SWITCH(GenderAll[Gender], "Male", [MalePct], "Female", [FemalePct], "All", [AllPct]))
3) Now create your regular column chart and it show as you want.
- bee_kissme9 years agoRegular Visitor
Dear SqlJason
I create following as you but it is not the spacing.
MalePct = CALCULATE(COUNTA(dim_personal[sex]), dim_tec_personal[sex]="male")
FemalePct = CALCULATE(COUNTA(dim_personal[sex]), dim_tec_personal[sex]="female")
AllPct = CALCULATE(COUNTA(dim_personal[sex]), dim_personal[sex]="male" || dim_personal[sex]="female")
TestAll = SUMX(VALUES(dim_personal[sex]), SWITCH(dim_personal[sex], "male", [MalePct], "female", [FemalePct], "all", [AllPct]))
I - Create clustered column chart
1) Create the below 3 measures (change table names appropriately)
2) Create clustered column chart with just these 3 measures. You will get all three bars but they will not have the spacing.
II - Create disconnected table
1) Create a disconnected table GenderAll with 3 values for Gender - Male, Female, All
2) Now create a measure
3) Now create your regular column chart and it show as you want.
- SqlJason9 years agoMemorable Member
Can you put an image of your chart as well as an image of your model?
In the image of the chart, please make sure that yo are showing what is on X and Y axis.