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! It's time to submit your entry. Live now!
Hello all,
I have two tables, fBrazilBadge (badge swipes for brazil) and fHeadcount (global employee records). fBrazilBadge is linked to a date table. So far I have validated that I am getting the correct counts by date.
I am looking to create create a bar chart visual. I need to create a measure(s) that says, if "employee ID equals selected "location ID" count as "1" because I am only looking to calculate the attendance data of people who are pointed to one of the sites in Brazil.
e.g. January 7th, I have 10 people badging in. 3 of them have location ID that is not one of the sites in Brazil, the other 7 are. So the 7 people would be counted as having had been on site to their designated work location.
Solved! Go to Solution.
so I assume that in the headcoun table each employee has only one assgigned location. The measure could look like this
Batch-In Count of employees =
SUMX(
BatchTable,
CALCULATE(
IF(SELECTEDVALUE(BatchTable[Location ID] = SELECTEDVALUE(HeadCountTable[Location ID],1,0)
)
)
But for my current understanding you would nee to creat the relation via the employee table because you want to check whether the employee batches withint the home location.
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
so I assume that in the headcoun table each employee has only one assgigned location. The measure could look like this
Batch-In Count of employees =
SUMX(
BatchTable,
CALCULATE(
IF(SELECTEDVALUE(BatchTable[Location ID] = SELECTEDVALUE(HeadCountTable[Location ID],1,0)
)
)
But for my current understanding you would nee to creat the relation via the employee table because you want to check whether the employee batches withint the home location.
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
Hi @Anonymous,
First questions which arises for me is: Does the table fHeadcount have an EmployeeID? What is the granularity of this table? Because it seems not right to creat a relation over the location ID.
Best regards
Michael
Yes, the fHeadcount does have employeeID. I did a merge query to do a fuzzy match using name on both fHeadcount and fBrazilBadge to bring EmployeeID to fBrazilBadge as it does not have that data.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 60 | |
| 49 | |
| 30 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 131 | |
| 103 | |
| 58 | |
| 39 | |
| 31 |