Hello
I have two tables (Order, Services).
When i do an orden and add services, I need to know the total of time of services.
How can i do it?
)
Solved! Go to Solution.
Assuming your Time column is of Duration type and [Services] of ENUMLIST, then you can get the total duration by
SUM(
SELECT(
SERVICES[TIME],
IN([SERVICE],[_THISROW].[SERVICES]
)
)
Another thing I noticed is that [SERVICES] collects labels rather than IDs of the SERVICES table. This may not be a big issue here immediately but, I would change it to ENUMLIST, Ref to SERVICES in the long term.
Assuming your Time column is of Duration type and [Services] of ENUMLIST, then you can get the total duration by
SUM(
SELECT(
SERVICES[TIME],
IN([SERVICE],[_THISROW].[SERVICES]
)
)
Another thing I noticed is that [SERVICES] collects labels rather than IDs of the SERVICES table. This may not be a big issue here immediately but, I would change it to ENUMLIST, Ref to SERVICES in the long term.
Appear this error " The 'SUM' function requires a list of numeric inputs "
Your [TIME] column should be of type Duration as I already mentioned.
Then SUM() calculates the column properly as can be seen here.
User | Count |
---|---|
43 | |
26 | |
24 | |
14 | |
12 |