Hello everyone! I had a table that has a QUE...

(Aparicio Piñeyrúa) #1

Hello everyone!

I had a table that has a QUERY, where this QUERY sum´s and filter data for [Customer], by [$ total spend], [year] and [weeknum].

At this table I had this formua in a virtual column: SUM(SELECT(Query[$ total spend],[Customer]=[_THISROW].[Customer]))

Also had a virtual columns that belongs to the current weeknum

How can I filter the SUM formula to show only the total SUM for the current week of the year for each customer?

Many thanks!

(Aleksi Alkio) #2

SUM(SELECT(Query[$ total spend],AND([Customer]=[_THISROW].[Customer],[Year]=YEAR(TODAY()),[Weeknum]=WEEKNUM(TODAY()))))

(Aparicio Piñeyrúa) #3

@Aleksi_Alkio

Is is not filtering by week. As it shows in the picture, is SUM´s but not maing the filter per week/per year

(Aparicio Piñeyrúa) #4
(Aleksi Alkio) #5

At least one comma s missing…

(Aparicio Piñeyrúa) #6

@Aleksi_Alkio

I check the comma´s and I think there are ok. May be this happen beacause of the Computedkey?

(Aleksi Alkio) #7

Did you find the missing comma from here… YEAR(TODAY()),[Weeknum]

(Aparicio Piñeyrúa) #8

@Aleksi_Alkio

=SUM(SELECT(Query[Driver Up to today],AND([Driver]=[_THISROW].[Driver],[Year]=YEAR(TODAY()),[Week]=WEEKNUM(TODAY()))))

Still not showing a good SUM result when I check on “Test”. The math doesn´t fix to the formula in the “Test”

(Aleksi Alkio) #9

Well… do you think the query is correct in generally?