Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I'm trying to create comparison between data. In particular, I want to compare data of the selected Employee against the data of all the unselected employees.
I have a filter on the page to select a single employee, trying to use the selected/unselected as legend of a scatter chart. Is it possible?
Example:
Employee A, employee B, employee C. If the user select in the filter employee A, the scatter chart will show the points of employee A and then employee B + employee C as "Other employees".
Thanks
Thanks for the reply from Sahir_Maharaj.
Hi @user-2024,
Based on your description I created simple data:
Create two new tables on top of this, one for the legend of the scatter chart and one for the slicer.
Then create a measure:
Measure =
VAR _selected=SELECTCOLUMNS('EmployeeSlicer','EmployeeSlicer'[Employeename])
VAR _unselected=EXCEPT(ALL('EmployeeTable'[Employeename]),_selected)
VAR _unselectedtotal=SUMX(FILTER(ALL('EmployeeTable'),'EmployeeTable'[Employeename] IN _unselected),'EmployeeTable'[Value])
RETURN
SWITCH(MAX('NewEmployee'[Employeename]),"other employees",_unselectedtotal,SELECTEDVALUE('EmployeeSlicer'[Employeename]),SUM('EmployeeTable'[Value]))
Results:
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Also in your sample data, the others employee total doesn't reflect the year, but it's constant considering both 2023 and 2024.
Thanks for the reply. The output is near to what I wanted, but there's still somethinf to fix. I exaplin better the expected result.
As you see in the image, for the active employee (light blue) the dots are okay. While for the Others, the value is constant to the average of all of them, regardless of the x-axis. Is it possible to have also for the Others employee, not an aggregation, but all the points with their single value?
Expected outcome:
Hello @user-2024,
Can you please tyr this approach:
Employee Category =
VAR SelectedEmployee = SELECTEDVALUE(EmployeeTable[EmployeeName])
RETURN
IF(
ISBLANK(SelectedEmployee),
"All Employees",
IF(
EmployeeTable[EmployeeName] = SelectedEmployee,
"Selected Employee",
"Other Employees"
)
)
Thanks for the reply.
The scatter chart does not allow me to put a measure as a legend
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!