SUM expenses current month until yesterday

Hello guys,

i'd like to sum the value "importo" from the table "spese" of current month BUT until yesterday

example:

Date                  Importo

01/01/2023.         3

02/01/2023        3

03/01/2023        2

04/01/2023.       5

Result:   because is the sum from 01/01/2023 to 03/01/2023

How can i integrate this formula:

SUM(
SELECT(spese[importo],
AND(MONTH([DATA]) = MONTH(TODAY()), YEAR([DATA])=YEAR(TODAY())
))

 

Thanks guys!!

 

Solved Solved
0 2 116
1 ACCEPTED SOLUTION

Please try 

SUM(
SELECT(spese[importo],
AND(MONTH([DATA]) = MONTH(TODAY()), YEAR([DATA])=YEAR(TODAY()), DAY([DATA])< DAY(TODAY()))
))

You may first want to create a slice called Current Month spece for the current month dates with an expression something like below

AND(MONTH([DATA]) = MONTH(TODAY()), YEAR([DATA])=YEAR(TODAY()), DAY([DATA])< DAY(TODAY()))

Then the sum expression can be simply SUM( Current Month spece[importo]))

View solution in original post

2 REPLIES 2

Please try 

SUM(
SELECT(spese[importo],
AND(MONTH([DATA]) = MONTH(TODAY()), YEAR([DATA])=YEAR(TODAY()), DAY([DATA])< DAY(TODAY()))
))

You may first want to create a slice called Current Month spece for the current month dates with an expression something like below

AND(MONTH([DATA]) = MONTH(TODAY()), YEAR([DATA])=YEAR(TODAY()), DAY([DATA])< DAY(TODAY()))

Then the sum expression can be simply SUM( Current Month spece[importo]))

@Suvrutt_Gurjar thanks to you finally i completed the formula that consent to create a daily saving according to the monthly amount that you want save!

I post here the expression that consent to do this in case could be useful for someone else

Schermata 2023-01-04 alle 15.51.48.png

Top Labels in this Space