Forum Discussion
MiKeZZa
Post Patron
9 years agoCreate Pie chart with group by
Hi all, I have a dataset like this: emp nr year_month uniquenumber 161860 201702 25005 161860 201702 25006 161860 201703 25007 365630 201702 25008 365...
v-huizhn-msft
Microsoft Employee
9 years agoHi MiKeZZa,
Plesae add another filter in times calculated columns. You will get correct result.
times = CALCULATE(SUM(Table3[number]),ALLEXCEPT(Table3,Table3[emp nr],Table3[costcentre]))
Then create measure like the solution above.
Best Regards,
Angelia
MiKeZZa
Post Patron
9 years agoHi v-huizhn-msft thanks for you're patience.... But something goes wrong. I now have:
numberofcategories = CALCULATE(SUM('table name'[empnr]),ALLEXCEPT('table name','table name'[empnr],'table name'[costcenter]))
incidentcount = sum('table name'[numberofincidentsinmonth])
percentage = CALCULATE(COUNTAX(DISTINCT(SELECTCOLUMNS('table name',"empnr",'table name'[empnr],"num",'table name'[numberofcategories])),'table name'[incidentcount]),ALLEXCEPT('table name','table name'[numberofcategories]))/CALCULATE(COUNTAX(DISTINCT(SELECTCOLUMNS('table name',"empnr",'table name'[empnr],"num",'table name'[numberofcategories])),'table name'[incidentcount]),ALL('table name'))And this results in this piechart:
I'm pretty sure I've done everything that you suggest, but it's clear that something is wrong.