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

Cumulative/Running Total for FYTD and FYTD YA

hi, i've been googling and digging into power bi forum and still, i've been stuck trying to calculate Total Sales between a given MONTH, in this case, the begining of the FY (fiscal year) and the latest month available in the database (up until Jun following year, when the fiscal year ends). to note, FY starts in Jul, not Jan, hence, DATESYTD will not work.

 

specifically, i need a sum of sales starting in July and ending in any new month when sales data comes:

- FYTD  = sales for 1 month - if only July'18 sales data available

- FYTD = sales for 2 months - if Jul'18 + Aug'18 sales data available, etc.

...

- the latest FYTD = sum of Jul-Dec'18 sales

- the last one FYTD cumulative for FY18/19 will be a sum of Jul'18-Jun'19 sales

...and then it needs to start claculating FYTD again as of Jul'19

i also need:

- FYTD YA - same logic but Year Ago e.g. Jul-Dec'17

...the last one will enable to compare fiscal-year-to-date vs same period year ago.

 

overall, i have data for several years, so below formula will not help me, as it calculates the entire sales since the first data point available until today.

Capture.JPG

 

i need is to set up a formula in a way it has a cut off point in July and runs until today = last month available. however, considering that fiscal year always ends in June, I believe, another cut off point is needed for June (still, if I have data until Dec, Jun is only in the future).

 

my date format is the following:

Capture.JPG

 

do I need to create a seperate Calendar Table and use it for my calculation? or is there any particular DAX formula that can help me to create a relevant measure?

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Create a Calendar Table and build a relationship from the Date column of the All Table to the Date column of the Calendar Table.  In the Calendar Table, write these calculated column formulas to extract Year and Month.  Year = Year(Calendar[Date]) and Month = FORMAT(Calendar[Date],"mmmm").  In your visual drag Year and Mone from the Calendar Table.  Write these measures

 

Total sales = SUM('All'[Sales vlaue 1000 EUR])

FYTD = CALCULATE([Total Sales],DATESYTD(Calendar[Date],"30/6"))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Create a Calendar Table and build a relationship from the Date column of the All Table to the Date column of the Calendar Table.  In the Calendar Table, write these calculated column formulas to extract Year and Month.  Year = Year(Calendar[Date]) and Month = FORMAT(Calendar[Date],"mmmm").  In your visual drag Year and Mone from the Calendar Table.  Write these measures

 

Total sales = SUM('All'[Sales vlaue 1000 EUR])

FYTD = CALCULATE([Total Sales],DATESYTD(Calendar[Date],"30/6"))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

thanks a lot!

 

took me a while to vizualize it, as you need to pull a correct date range, so the sum displays well and the column is not full of blanks.... still, now it works perfectly. i've just used this formula, instead of creating additional "Total Sales" measure

 

FYTD = CALCULATE(sum('All'[Sales Value 1000 EUR]);DATESYTD('Calendar Table'[Date Full];"30/6"))
 
 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.