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
Anonymous
Not applicable

Today minus 1 year

Hi,

 

Im new to Power BI & DAX and I've the next problem:
I have 2 kind of date columns: invoicedate and departure date and 1 sales column: invoicetotal.

 

Departuredate shows the value of sales when a customer is going to fly example:

invoicedate: 10-10-2018 
invoicetotal: €100 

departuredate: 02-02-2019

 

So we've booked in 2018 a salestotal of 100€ (by invoicedate), but the customer flies in 2019. So my sales by departuredate is in 2019 €100.

 

I have now insights on sales by departuredate for 2019. I would like to calculate the same results for 2018. So my today status by invoicedate minus 1 year (2017) and how were the sales by departuredate for 2018. 

I could use slicers for the dates and select invoicedate by year, month and day of exactly the previous year en select 2018 as departureday. But I would love to automate this process into a measure. 

 

Something like [invoicedate] today () minus 1 year and with that date it calculates' the status of the departures in 2018.

 

 

 I hope someone can find a solution for this!!

 

Thank you!

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Have you solved your problem?

 

If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please share some data sample and your desired output so that we could help further on it.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

For your scenario, you could create the measure with DATEADD function or you could use Filter condition with Today( )-365.

 

If you still need help, please share some sample data and your desired output so that we could help further on it.

 

In addition, you could refer to this video Calculate Transactions In Last N Days in Power BI Using DAX.

 

Best  Regards,

Cherry

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

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.