Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi!
I need a card to show me the average of itens opened/day/employee. Is there a way for me to count this days?
For exemple, in the data below, I have 4 days (without the repetition) and 11 itens opened by 3 different employees.
The average would be:
Employee 1: 1,25 items opened by day
Employee 2: 0,75 items opened by day
Employee 3: 0,75 items opened by day
But I can't think of a way to count these days in which we have items...
Employee | Material | Date |
1 | AXT000 | 04/09/2022 |
2 | AXT001 | 04/09/2022 |
3 | AXT002 | 04/09/2022 |
1 | AXT003 | 04/11/2022 |
2 | AXT004 | 04/11/2022 |
1 | AXT005 | 04/13/2022 |
1 | AXT006 | 04/13/2022 |
1 | AXT007 | 04/13/2022 |
3 | AXT008 | 04/15/2022 |
2 | AXT009 | 04/15/2022 |
3 | AXT010 | 04/15/2022 |
Solved! Go to Solution.
Avg Per Employee =
AVERAGEX(
VALUES('Table'[Employee]),
VAR _min_date = CALCULATE(MIN('Table'[Date]))
VAR _max_date = CALCULATE(MAX('Table'[Date]))
VAR _days = INT(_max_date - _min_date)
VAR _items = CALCULATE(COUNTROWS('Table'))
RETURN
DIVIDE(_items, _days)
)
But I'm getting this:
This are the days calculated for every employee:
between 09/04 and 13/04 there 4 days not inclusive, but 5 inclusive so if 5 is what you want just add 1 to the VAR _days.
Anyway, in either option I didn't ge tthe numbers you wrote. Even if i took distinct count of the days instead of their diff.
If it should be your numbers, can you share the logic how you need to get to them
For example,
how many days need to be for each employee (only days where he open a ticket or the diff days etc)
Avg Per Employee =
AVERAGEX(
VALUES('Table'[Employee]),
VAR _min_date = CALCULATE(MIN('Table'[Date]))
VAR _max_date = CALCULATE(MAX('Table'[Date]))
VAR _days = INT(_max_date - _min_date)
VAR _items = CALCULATE(COUNTROWS('Table'))
RETURN
DIVIDE(_items, _days)
)
But I'm getting this:
This are the days calculated for every employee:
between 09/04 and 13/04 there 4 days not inclusive, but 5 inclusive so if 5 is what you want just add 1 to the VAR _days.
Anyway, in either option I didn't ge tthe numbers you wrote. Even if i took distinct count of the days instead of their diff.
If it should be your numbers, can you share the logic how you need to get to them
For example,
how many days need to be for each employee (only days where he open a ticket or the diff days etc)
User | Count |
---|---|
98 | |
90 | |
78 | |
71 | |
64 |
User | Count |
---|---|
112 | |
96 | |
95 | |
67 | |
65 |