Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
32 | |
27 | |
27 | |
26 |
User | Count |
---|---|
61 | |
56 | |
33 | |
29 | |
27 |