Forum Discussion
pradeept
5 years agoResolver I
One vs Rest
Hi Community, I have employee feedback data. Dataset: EmpID, DeptID, Rating,.. There are 8 departments. Ratings (1,2,......,10) Scenario: I want to create bar charts to compare the Average ...
- Anonymous5 years ago
Hi pradeept ,
Please follow these steps:
1. Create a table for X-axis by entering data like this:
2. Just need one measure:
Expected output = var _curr=CALCULATE(SUM('Table'[Rating]),ALLEXCEPT('Table','Table'[Department])) var _rest=CALCULATE(AVERAGE('Table'[Rating]),FILTER(ALL('Table'),'Table'[Department]<>MAX('Table'[Department]))) return IF(MAX('X-axis'[Type])="Rest",_rest,IF(MAX('Table'[Department]) =MAX('X-axis'[Type]),_curr))The final output is shown below:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
5 years agoNot applicable
Hi pradeept ,
Please try this:
Expected output =
var _curr= CALCULATE(SUM('Table'[Rating]),FILTER('Table','Table'[Department]=MAX('X-axis'[Type])))
var _notSele=CALCULATE(DISTINCTCOUNT('Table'[Department]),ALL('Table'))-DISTINCTCOUNT('Table'[Department])
var _rest=CALCULATE(SUM('Table'[Rating]),FILTER('Table',[Department] in ALLSELECTED('X-axis'[Type])))
return IF(MAX('X-axis'[Type])="Rest",DIVIDE(CALCULATE(SUM('Table'[Rating]),ALL('Table'))-_rest,_notSele),IF(MAX('X-axis'[Type]) in ALLSELECTED('Table'[Department]),_curr))
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.