cancel
Showing results for
Did you mean:
Helper I

## Count of Sales needed

HI all,

I am looking to do 2 different measures which gives me the following: -

- for each date, I want to see the last 7 days of sales

- for each date, I want to see the last 30 days of sales

Example: - Today, I want to see that yesterdays date contains the count of sales for (22nd, 21st, 20th, 19th, 18th, 17th & 16th) which would then mean that 21st date would contact count of sales from 21st - 15th) - Of course the other measure should be doable by amending this one.

In my table,

Hope that makes sense.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support

You can mark it as answer by clicking below option:

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
7 REPLIES 7
Community Champion

@TheLegendTamer

Can you share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
____________________________________
How to paste sample data with your question?

_____________________________________
Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

Helper I

The below is what I am hoping for - dont have any sample data yet im afraid.

3 measures in total - yesterday which is fine. Then last 7 days and last 30 days. So looking at yesterdays date on the 'x' axis it gives sum of sales from yesterday, last 7 days from yesterday and last 30 days from yesterday.

Memorable Member

you can use something like

Rolling 7 Day Amount = CALCULATE(SUM(table[Value]),DATESINPERIOD(DimDate[Date],MAX(DimDate[Date]),-7,DAY))

Rolling 30 Day Amount = CALCULATE(SUM(table[Value]),DATESINPERIOD(DimDate[Date],MAX(DimDate[Date]),-30,DAY))
Helper I

Diamond! Thank you muchly

Community Support

If the above posts help, please kindly mark it as a answer to help others find it more quickly. thanks!

If not, please kindly elaborate more.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Helper I

I have marked it as a thumbs up, doesnt this mean its the answer?

Community Support

You can mark it as answer by clicking below option:

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Power Platform October Community Highlights

Check out the top community contributors across all of the communities

#### Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors