Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
csalinas23
Helper II
Helper II

¿Como sumar fechas que yo indique?

Hola,

 

 

Favor me ayudan con saber lo siguiente; Tengo el campo Sell Out y el campo On hand. La fecha sell out tiene todos los días y la fecha stock día por medio. En base a la siguiente visualización:

 
¿Cómo puedo dejar reflejado en Sell Out los últimos 7 días?
¿Cómo puedo dejar en stock la fecha más reciente?

 

csalinas23_1-1596208078617.png

 

 

Quedo atento

Saludos

2 REPLIES 2
v-zhenbw-msft
Community Support
Community Support

Hi @csalinas23 ,

 

If you want to get the value of the past 7 days and the latest date, we can create two measures to meet your requirement.

 

Sell Out the last 7 days = 
var _max_date = CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))
var _last_7_days = _max_date - 7
return
CALCULATE(SUM('Table'[Sell Out]),FILTER('Table','Table'[Date]>_last_7_days && 'Table'[Date]<=_max_date))

 

the most recent date = 
CALCULATE(MAX('Table'[Date]),ALLSELECTED('Table'))

 

C1.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data or describe the fields of each tables and the relations between tables simply in English?

 

It will be helpful if you can show us the exact expected result based on the tables.

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

amitchandak
Super User
Super User

@csalinas23 , You can get rolling 7 like

Rolling 7 days = CALCULATE(sum(Sal[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-7,Day))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.