Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi everyone, I need a help with the following scenario.
Data :
Employee | Availability |
A | Allocated |
B | Available |
C | Available |
A | Leave |
Problem Statement:
If you could see in the visual provided, the distinct count of employees that I have is 619.
But if we refer to the pie chart there are (608+144+581 = 1333) employees.
I want to get a list of employees who are tagged to multiple "Availability" category. For example in the dataset above "employee A" is tagged to both "Allocated" and "Leave" catgegories.
Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. Assume that there is one table with the similar structer as the table below in your model, you can create a calculated column as below to get the latest availablity for per employee:
Latest availability =
VAR _maxdate =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( 'Table', 'Table'[Employee] = EARLIER ( 'Table'[Employee] ) )
)
RETURN
CALCULATE (
MAX ( 'Table'[Availability] ),
FILTER (
'Table',
'Table'[Employee] = EARLIER ( 'Table'[Employee] )
&& 'Table'[Date] = _maxdate
)
)
Then put the new calculated column onto the pie chart to replace the original field [Availability]:
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @Anonymous ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want. Assume that there is one table with the similar structer as the table below in your model, you can create a calculated column as below to get the latest availablity for per employee:
Latest availability =
VAR _maxdate =
CALCULATE (
MAX ( 'Table'[Date] ),
FILTER ( 'Table', 'Table'[Employee] = EARLIER ( 'Table'[Employee] ) )
)
RETURN
CALCULATE (
MAX ( 'Table'[Availability] ),
FILTER (
'Table',
'Table'[Employee] = EARLIER ( 'Table'[Employee] )
&& 'Table'[Date] = _maxdate
)
)
Then put the new calculated column onto the pie chart to replace the original field [Availability]:
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @v-yiruan-msft , first of all I would like to thank you. I really appreciate your time and efforts. I would like to understand this peice of code better. I want to know what exactly are you trying to do in the first half of the code i.e when you define the variable. Could you please try to explain that piece of code in plain english so that I can understand it properly.
Thanks again.
Hi @Anonymous ,
The following part of the code is to get the last work date of each employee.
And the following part of this code is to get the status of each employee on last work date.
In order to give you a solution that fits your scenario, you can provide some sample data inside your model(exclude sensitive data) and some examples to show your final desired result. Thank you.
Best Regards
User | Count |
---|---|
131 | |
108 | |
101 | |
67 | |
64 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |