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

Regular Visitor

## Creating a Column to Sum Value for Today and the Next Two Days

I'm looking for help with creating a Column (called Sun+2days) that will show me the sum of a value for today and the next two days.  The entire table will have roughly 250 lines.

Example (using Table1)

Date             Amount              Sum+2days

1/1/23            \$100                 \$175

1/2/23            \$25                   \$150

1/3/23            \$50                   \$250

1/4/23            \$75                   \$2250

1/5/23            \$125                 \$125

1/6/23            \$25                   \$25

1/7/23            \$0                     \$0

1/8/23            \$0                     \$0

And so on.

Any help would be greatly appreciated.

2 ACCEPTED SOLUTIONS
Community Support

Hi, @fsu5078

You can try the following methods.

``Date+1 = CALCULATE(MAX('Table'[Amount]),FILTER('Table',[Date]=EARLIER('Table'[Date])+1))``
``Date+2 = CALCULATE(MAX('Table'[Amount]),FILTER('Table',[Date]=EARLIER('Table'[Date])+2))``
``Sum+2days = [Amount]+[Date+1]+[Date+2]``

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

Regular Visitor

Thank you.  This worked perfectly.

3 REPLIES 3
Community Support

Hi, @fsu5078

You can try the following methods.

``Date+1 = CALCULATE(MAX('Table'[Amount]),FILTER('Table',[Date]=EARLIER('Table'[Date])+1))``
``Date+2 = CALCULATE(MAX('Table'[Amount]),FILTER('Table',[Date]=EARLIER('Table'[Date])+2))``
``Sum+2days = [Amount]+[Date+1]+[Date+2]``

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

Regular Visitor

Thank you.  This worked perfectly.

Super User

@fsu5078 , a new column

Sumx(filter( Table, Table[Date]>= earlier(Table[Date]) && Table[Date]<= earlier(Table[Date]) +2 ) ,[Amount])

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.