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
aquan
Frequent Visitor

Get monthly figures from financial YTD

Hello

 

I have a list of YTD figures with the YTD ending on 30-June each year.

The data is uploaded monthly.

 

The below measure works for every month except July (which would require adjustment). How would I adjust the measure so that in the July month only, it doesn't take away June. I want the measure to work across multiple years.

 

var CurrentYTD = sum(Financial[Total Actual])

var PriorMonthYTD = CALCULATE(SUM(Financial[Total Actual]),PARALLELPERIOD('Calendar'[Date],-1,MONTH))



return
(CurrentYTD - PriorMonthYTD)
4 REPLIES 4
Stachu
Community Champion
Community Champion

does this work as you expect?

Measure =
VAR __CurrentYTD =
    SUM ( Financial[Total Actual] )
VAR __PriorMonthYTD =
    IF (
        MONTH ( MAX ( 'Calendar'[Date] ) ) = 7,
        0,
        CALCULATE (
            SUM ( Financial[Total Actual] ),
            PARALLELPERIOD ( 'Calendar'[Date], -1, MONTH )
        )
    )
RETURN
    ( __CurrentYTD - __PriorMonthYTD )

if not, can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

Column1Column2
A1
B2.5

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

aquan
Frequent Visitor

I had tried that also. But this only works if you only select 1 month.

If you select a range of months then 

MAX ( 'Calendar'[Date])

 will no longer be max (if i understand correctly)

If you have another solution using "M" that would be even better.

 

  Cumulative Period
1/05/201631/05/20167  7
1/06/201630/06/20169  2
1/07/201631/07/20162  2
1/08/201631/08/20164  2
1/09/201630/09/20166  2
1/10/201631/10/20169  3
1/11/201630/11/201610  1
1/12/201631/12/201616  6
1/01/201731/01/201725  9
1/02/201728/02/201735  10
1/03/201731/03/201745  10
1/04/201730/04/201754  9
1/05/201731/05/201763  9
1/06/201730/06/201765  2
1/07/201731/07/20178  8
1/08/201731/08/201710  2
1/09/201730/09/201719  9
1/10/201731/10/201723  4
1/11/201730/11/201729  6
1/12/201731/12/201735  6
1/01/201831/01/201840  5
1/02/201828/02/201849  9
1/03/201831/03/201858  9
1/04/201830/04/201863  5
1/05/201831/05/201871  8
1/06/201830/06/201873  2
Stachu
Community Champion
Community Champion

I thought your values are cumulative, so if you would have double counting for the overlapping periods. If that's not the case, then why not use DATESYTD with custom year end to get the YTD, e.g.

Sales = SUM(Financial[Total Actual])

Sales YTD = CALCULATE([Sales], DATESYTD(Calendar[Date], "30-06")

that way the Sales YTD will give you the YTD figure even with 1 month selected, slightly different navigation logic, but much easier to implement



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

aquan
Frequent Visitor

Yes - they are cumulative-financial year to date.

 

Ok so get the YTD then offset the financial year by 1 month then subtract... DATESYTD I'll give it a try. Thanks.

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.

Top Solution Authors