cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
nranito Regular Visitor
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
nranito Regular Visitor
Regular Visitor

Re: Calculate Total Previous Day

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

View solution in original post

2 REPLIES 2
Floriankx Established Member
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.

nranito Regular Visitor
Regular Visitor

Re: Calculate Total Previous Day

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

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)