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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
metcala
Helper III
Helper III

Current month value using YTD minus previous month YTD

Hi

 

Sorry for the basic question.

 

I currently have a table with the following

 

DateUnitActivityYTD
30/1/23AX

10

30/1/23AY15
30/1/23AZ5
30/1/23BY20
30/1/23BZ5
28/2/23AX

15

28/2/23AY25
28/2/23AZ15
28/2/23BY25
28/2/23BZ15

 

Currently trying to write a measure that will allow the following output

 

DateUnitActivityMonthly Total
30/1/23AX

10

30/1/23AY15
30/1/23AZ5
30/1/23BY20
30/1/23BZ5
28/2/23AX

5

28/2/23AY10
28/2/23AZ10
28/2/23BY5
28/2/23BZ10

 

This is as far as I've got.... doesn't reflect unit/activity but couldn't even get previous month YTD working.

 

 

Monthly Total = CALCULATE(
SUM('Table'[YTD]),
FILTER('Table','Table'[Date]=EOMONTH('Table'[Date],-1))
)

 

 

Any help would be much appreciated!

1 ACCEPTED SOLUTION
FreemanZ
Community Champion
Community Champion

or like:

Column2 = 
[YTD]-
CALCULATE(
    SUM(data[YTD]),
    data[date]=EOMONTH(EARLIER(data[date]), -1),
    ALLEXCEPT(data, data[Unit], data[Activity])
)

FreemanZ_1-1683856002700.png

View solution in original post

9 REPLIES 9
FreemanZ
Community Champion
Community Champion

hi @metcala 

why Jan 30 not 31? what other values do you have for the date column?

@FreemanZ  Apologies this was just me adding the incorrect date for the example data.

FreemanZ
Community Champion
Community Champion

so the actual data is?

@FreemanZ As the data itself is sensitive I've anonymised the field names but the categories are the same as the original data.

FreemanZ
Community Champion
Community Champion

hi @metcala 

by actual data, i mean Jan 30 or 31?

Sorry it is always the end of the month so 31 Jan...my bad

FreemanZ
Community Champion
Community Champion

or like:

Column2 = 
[YTD]-
CALCULATE(
    SUM(data[YTD]),
    data[date]=EOMONTH(EARLIER(data[date]), -1),
    ALLEXCEPT(data, data[Unit], data[Activity])
)

FreemanZ_1-1683856002700.png

 

@FreemanZ 

 

Thank you very much for your help!

 

Much appreciated!

FreemanZ
Community Champion
Community Champion

hi @metcala 

it is always good to clarify first and no harm is done. 

please try to add a calculated column like:

Column = 
[YTD]-
MAXX(
    FILTER(
        data,
        data[date]=EOMONTH(EARLIER(data[date]), -1)
            &&data[Unit]=EARLIER(data[Unit])
            &&data[Activity]=EARLIER(data[Activity])
    ),
    data[YTD]
)

it worked like:

FreemanZ_0-1683855846970.png

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.