Reply
vicsinc
Frequent Visitor
Partially syndicated - Outbound

Show YOY Cumulative values on line chart

I have a line chart that shows cumulative number of leads received vs target leads. Nothing fancy.

vicsinc_0-1720013756536.png

I wish to add a third line to show the Previous Year cumulative leads received.

 

The cumulative measure is calculated as follows:

 

CumLeadsActual = CALCULATE(SUM('Leads'[Leads Actual]),FILTER(ALLSELECTED('Leads'),'Leads'[Month]<=MAX('Leads'[Month])&&'Leads'[IsCurrentMonth]="Past Month"))

 
When I try to use Same Period Last Year, it's not working as expected as it's showing me monthly figures instead of cumulative
LYCumLeads = CALCULATE([CumLeadsActual], SAMEPERIODLASTYEAR('Leads'[Month]))
 
Please could somebody help?
 
Thank you
 
Vic
 

 

 

1 ACCEPTED SOLUTION
v-kongfanf-msft
Community Support
Community Support

Syndicated - Outbound

Hi @vicsinc ,

 

You can try below formula to create measures:

LYCumLeads = 
VAR CurrentMonth = MAX('Leads'[Month])
RETURN
CALCULATE(
    [CumLeadsActual],
    FILTER(
        ALLSELECTED('Leads'),
        'Leads'[Month] <= EOMONTH(CurrentMonth, -12)
    )
)
CumLeadsActual = 
CALCULATE(
    SUM('Leads'[Leads Actual]),
    FILTER(
        ALLSELECTED('Leads'),
        'Leads'[Month] <= MAX('Leads'[Month]) && 'Leads'[IsCurrentMonth] = "Past Month"
    )
)

 

vkongfanfmsft_0-1720058500072.png

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-kongfanf-msft
Community Support
Community Support

Syndicated - Outbound

Hi @vicsinc ,

 

You can try below formula to create measures:

LYCumLeads = 
VAR CurrentMonth = MAX('Leads'[Month])
RETURN
CALCULATE(
    [CumLeadsActual],
    FILTER(
        ALLSELECTED('Leads'),
        'Leads'[Month] <= EOMONTH(CurrentMonth, -12)
    )
)
CumLeadsActual = 
CALCULATE(
    SUM('Leads'[Leads Actual]),
    FILTER(
        ALLSELECTED('Leads'),
        'Leads'[Month] <= MAX('Leads'[Month]) && 'Leads'[IsCurrentMonth] = "Past Month"
    )
)

 

vkongfanfmsft_0-1720058500072.png

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)