Skip to main content
cancel
Showing results for
Search instead 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

## Volumes over a 7 day period Formula

Hi how do I combine these two Dax Measures to should Total Voumes by client but only over the last 7 days?

Dax Formula for Volumes.

Client Volumes =
CALCULATE(SUM(production[Total Accepted]),FILTER(ALLSELECTED(production),EARLIER(production[client_name])=production[client_name]))

Dax Formula for last 7 days.
```7 Day RT MEASURE =
CALCULATE (
SUM ( Production[Total Accepted] ),
DATESINPERIOD ( Table1[Date], LASTDATE ( Table1[Date] ), -7, DAY )
)```

How do I write this so I can show the volumes for only the last 7 days?

Thanks in Advance.

2 REPLIES 2
Super User

@Enrico501 , Use a separate date table, it will sum for the same client automatically

7 Day RT MEASURE =
CALCULATE (
SUM ( Production[Total Accepted] ),
DATESINPERIOD ( Date[Date], Max ( Date[Date] ), -7, DAY )
)

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Frequent Visitor

Hi

The date table is built already. has been for months. Power BI 101.

I have a 3 month feed. At the moment the Volume DAX formula calculates over the entire three months of the feed. What I need it to be able to dictate how long a period it calculates the volumes over. eg 1 week, 2 weeks etc. hence conbining the to DAX formulas.

Thanks in advance.

## Helpful resources

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.

#### Join our Community Sticker Challenge

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors