Forum Discussion
One vs Rest
- 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.
amitchandak Thanks for quick response.
the solution you provided will work, if we are we showing all the departments in one chart.
You can see the below expected output (in excel). Any thoughts to achieve this?
In PowerBI, I tried with 2 charts. I created 2 measures for each chart, in total 4 measures. If I go with this approach, I need to create 16 (8 X 2 ) measures in total. After doing this also, I am not able to showcase the Labels on X-axis.
(Later, I am looking for the dynamic solution which we can reduce the number of measures in count, from 16 to 4-6)