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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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