cancel
Showing results for
Did you mean:
Regular Visitor

## Calculate Total Previous Day

I have two tables

Calendar, with days

Totals, with Total (let's say sales) per day

Created in table Totals the following measures:

T = SUM(Totals[sales])

PreviousDay = SELECTEDVALUE(Calendar[Day]) -1

TPreviousDay = CALCULATE(Totals[T], FILTER(ALL(Calendar), Calendar[DAY] = [PreviousDay]))

But the TPreviousDay comes always blank...

If I replace [PreviousDay] by a value, it returns the correct value.

Any help?

1 ACCEPTED SOLUTION

Accepted Solutions
Regular Visitor

## Re: Calculate Total Previous Day

Fixed it by replacing Calendar[DAY]  with SELECTEDVALUE(Calendar[DAY] )

2 REPLIES 2
Established Member

## Re: Calculate Total Previous Day

You could add a calculated column for previous day:

CALCULATE(Totals[T];FILTER(Calendar;Calendar[Day]+1=EARLIER(Calendar[Day]))

Then you can Sum this Column in a Measure and this should do the job.

Regular Visitor

## Re: Calculate Total Previous Day

Fixed it by replacing Calendar[DAY]  with SELECTEDVALUE(Calendar[DAY] )

Announcements

Kudos to you if you earned one of these! Check your inbox for a notification.

#### Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

#### Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,392)