cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Cumulatieve SPEND over a year HELP

Spend = CALCULATE (
SUM (T_PurInvoiceMain[BasicCurrNetPrice_FactuurLeverancier]  ),
FILTER (
ALLSELECTED ( T_PurInvoiceMain ),
T_PurInvoiceMain[Processed YEAR] <= MAX ( T_PurInvoiceMain[Processed YEAR] )
&& MIN (T_PurInvoiceMain[Processed YEAR]) <= TODAY ()))

1 ACCEPTED SOLUTION
Community Support

Hi @KasRotodyne ,

According to the formula you provided, today() gets the current date value instead of the year, you need to convert the formula by year(today()).

Try measure like below:

``````Spend =
CALCULATE (
SUM ( T_PurInvoiceMain[BasicCurrNetPrice_FactuurLeverancier] ),
FILTER (
ALL ( T_PurInvoiceMain ),
T_PurInvoiceMain[Processed YEAR] <= MAX ( T_PurInvoiceMain[Processed YEAR] )
&& MIN ( T_PurInvoiceMain[Processed YEAR] ) <= YEAR ( TODAY () )
)
)``````

If the problem is still not resolved, you need to provide the relevant test data and a screenshot of the desired result, so that I can answer your question as soon as possible. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Community Support

Hi @KasRotodyne ,

According to the formula you provided, today() gets the current date value instead of the year, you need to convert the formula by year(today()).

Try measure like below:

``````Spend =
CALCULATE (
SUM ( T_PurInvoiceMain[BasicCurrNetPrice_FactuurLeverancier] ),
FILTER (
ALL ( T_PurInvoiceMain ),
T_PurInvoiceMain[Processed YEAR] <= MAX ( T_PurInvoiceMain[Processed YEAR] )
&& MIN ( T_PurInvoiceMain[Processed YEAR] ) <= YEAR ( TODAY () )
)
)``````

If the problem is still not resolved, you need to provide the relevant test data and a screenshot of the desired result, so that I can answer your question as soon as possible. Looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User

@KasRotodyne , Try like

if year not date

Spend = CALCULATE (
SUM (T_PurInvoiceMain[BasicCurrNetPrice_FactuurLeverancier] ),
FILTER (
ALLSELECTED ( T_PurInvoiceMain ),
T_PurInvoiceMain[Processed YEAR] <= MAX ( T_PurInvoiceMain[Processed YEAR] )
&& (T_PurInvoiceMain[Processed YEAR]) <= year(TODAY ())))

id year column is a date

Spend = CALCULATE (
SUM (T_PurInvoiceMain[BasicCurrNetPrice_FactuurLeverancier] ),
FILTER (
ALLSELECTED ( T_PurInvoiceMain ),
T_PurInvoiceMain[Processed YEAR] <= MAX ( T_PurInvoiceMain[Processed YEAR] )
&& (T_PurInvoiceMain[Processed YEAR]) <= (TODAY ())))

Frequent Visitor

Nope

It still wont work. I have tried multiple ways and everytime it seems to work with other but not here.

#Error or the sum of all spend is what the funtion returns.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.