Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Atf23
Helper I
Helper I

Internal and External turnover

Hello,
I have 3 tables: Employee, Transactions and Date
in the table employee, we concatenate the monthly generated files where the unique field ID=employee_id+"_"+year(date)+"_"+month(date)

Atf23_0-1702035982468.png
The table Transactions that is related to the Table Employee (1,*)

Atf23_0-1702040741438.png

and there is a table Date related to the Employee Table (1,*)

And I have some slicers as follows:

Atf23_1-1702041019922.png


Here is what I want do:
I want to display using CARDS while considering the selected values within the slicers:
** Number of Present Employees 
** Number of Absent Employees
** Number of left Employees (an employee is considered as left if he left internallly the selected departement or the direction or he left the company)

** Number of transactions realized by present employees 

** Number of transactions realized by Absent employees 
** Number of transactions realized by left employees 

Thanks of you help

1 ACCEPTED SOLUTION
123abc
Community Champion
Community Champion

Here's a step-by-step guide:

  1. Number of Present Employees:

Present Employees = COUNTROWS(FILTER(Employee, Employee[Status] = "Present"))

 

Number of Absent Employees:

 

Absent Employees = COUNTROWS(FILTER(Employee, Employee[Status] = "Absent"))

 

Number of Left Employees:

 

Left Employees =
CALCULATE(
COUNTROWS(FILTER(Employee, Employee[Status] = "Left")),
USERELATIONSHIP(Employee[DateID], Date[DateID])
)

 

Number of Transactions by Present Employees:

 

Transactions by Present Employees =
CALCULATE(
COUNTROWS(FILTER(Transactions, RELATED(Employee)[Status] = "Present")),
ALLSELECTED(Transactions)
)

 

Number of Transactions by Absent Employees:

 

Transactions by Absent Employees =
CALCULATE(
COUNTROWS(FILTER(Transactions, RELATED(Employee)[Status] = "Absent")),
ALLSELECTED(Transactions)
)

 

Number of Transactions by Left Employees:

 

Transactions by Left Employees =
CALCULATE(
COUNTROWS(FILTER(Transactions, RELATED(Employee)[Status] = "Left")),
ALLSELECTED(Transactions)
)

 

Make sure to replace Status with the actual field that indicates the employee's status (Present, Absent, Left). Also, adjust the relationships in your model accordingly.

After creating these measures, you can add them to your report and use the slicers to dynamically filter the results based on the selected values.

Remember to customize the DAX measures based on your actual data model and field names.

 
 
 

View solution in original post

1 REPLY 1
123abc
Community Champion
Community Champion

Here's a step-by-step guide:

  1. Number of Present Employees:

Present Employees = COUNTROWS(FILTER(Employee, Employee[Status] = "Present"))

 

Number of Absent Employees:

 

Absent Employees = COUNTROWS(FILTER(Employee, Employee[Status] = "Absent"))

 

Number of Left Employees:

 

Left Employees =
CALCULATE(
COUNTROWS(FILTER(Employee, Employee[Status] = "Left")),
USERELATIONSHIP(Employee[DateID], Date[DateID])
)

 

Number of Transactions by Present Employees:

 

Transactions by Present Employees =
CALCULATE(
COUNTROWS(FILTER(Transactions, RELATED(Employee)[Status] = "Present")),
ALLSELECTED(Transactions)
)

 

Number of Transactions by Absent Employees:

 

Transactions by Absent Employees =
CALCULATE(
COUNTROWS(FILTER(Transactions, RELATED(Employee)[Status] = "Absent")),
ALLSELECTED(Transactions)
)

 

Number of Transactions by Left Employees:

 

Transactions by Left Employees =
CALCULATE(
COUNTROWS(FILTER(Transactions, RELATED(Employee)[Status] = "Left")),
ALLSELECTED(Transactions)
)

 

Make sure to replace Status with the actual field that indicates the employee's status (Present, Absent, Left). Also, adjust the relationships in your model accordingly.

After creating these measures, you can add them to your report and use the slicers to dynamically filter the results based on the selected values.

Remember to customize the DAX measures based on your actual data model and field names.

 
 
 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.