Forum Discussion
Exclude only one value from filtering
Hi Guys,
I have 2 linked tables.
the first has the time in minutes spent for the FTEs for all the services provided:
| Time | ||
| Services | m | Office |
| Service 1 | 206 | Office 3 |
| Service 2 | 932 | Office 1 |
| Service 3 | 510 | Office 2 |
| Service 4 | 331 | Office 1 |
| Service 5 | 23 | Office 2 |
| Service 6 | 1.225 | Office 1 |
| Service 7 | 39 | Office 3 |
| … | … | … |
the second table has the total potential of hours worked for each Office:
| FTE | |
| Office | Potential Hours |
| Office 1 | 1200 |
| Office 2 | 1500 |
| Office 3 | 2500 |
My objective is to understand the difference between potential hours and hours really spent on services.
So I got this formula to calculate the effective hours worked:
=
CALCULATE (
SUM ( Time[m] ),
FILTER ( FTE, FTE[Office] = EARLIER ( Time[Office] ) )
)
/ 60Now i have to filter out only Service 6 and I am pretty sure there is a smarter way than this:
(
CALCULATE (
CALCULATE ( SUM ( Time[m] ), Time[Services] = "Service 1" ),
FILTER ( FTE, FTE[Office] = EARLIER ( Time[Office] ) )
)
/ 60
)
+ (
CALCULATE (
CALCULATE ( SUM ( Time[m] ), Time[Services] = "Service 1" ),
FILTER ( FTE, FTE[Office] = EARLIER ( Time[Office] ) )
)
/ 60
)
...and so on...Then, when using related function to bring those number on another table, how do I keep Service 6 out of the Job? Should I filter it again manually?Waiting for your help.
Thanks
- Anonymous9 years ago
You could always add a condition to your calculations which could be: Time[Services]<>"Service 6"
This sets a condition for your calculation, which makes sure it always excludes service 6.
If I misunderstand your challenge, please let me know and elaborate.
Best,
Martin
11 Replies
- Greg_DecklerCommunity Champion
If you first measure is called "EffectiveHoursWorked" you could filter out Service 6 like this:
No6EffectiveHoursWorked = CALCULATE([EffectiveHoursWworked],FILTER(Time,[Services]<>"Service 6"))
- AnonymousNot applicable
You could always add a condition to your calculations which could be: Time[Services]<>"Service 6"
This sets a condition for your calculation, which makes sure it always excludes service 6.
If I misunderstand your challenge, please let me know and elaborate.
Best,
Martin
- CiuCiCiaoHelper I
Guys,
I you understood and solved my challenge at the same time I feel stupid now though :D
Thanks
- CiuCiCiaoHelper I
Dear Greg_Deckler Anonymous
I am back on my problem...
Now I have gone forward, I have the Operating Cost:
FTE Office Potential Hours Effective Hours Worked Operating Cost Non Operating Cost Office 1 1.200 1.000 9.400 10.000 Office 2 1.500 1.300 9.800 7.900 Office 3 2.500 2.000 22.000 2.900 I have to bring them back to the other table:
Time Services m Office Operating Cost Non Operating Cost Service 1 206 Office 3 ? ? Service 2 932 Office 1 … … Service 3 510 Office 2 … … Service 4 331 Office 1 … … Service 5 23 Office 2 … … Service 6 1.225 Office 1 0 0 Service 7 39 Office 3 … … … … … … … I have excluded before Service 6 from my calculation, but when bringing it back to the Time table, using the following formula, it will redistribuite also for Service 6.
= RELATED ( FTE[Operating Cost] ) * Time[m] / CALCULATE ( SUM ( Time[m] ), FILTER ( Time, Time[Office] = EARLIER ( Time[Office] ) ) )I tried different ways but non of them worked out...
Any help?
Thanks