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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
onedayover
Helper III
Helper III

Weekly year over year cumulative totals when weeks start on different dates

Hi all
I have a table for ticket purchases that looks like this...

Table.PNG

Ticket sales for 2023 start on a different date than in 2024. In order to do a comparison, I've added week numbers for each year starting at the first date tickets were sold (formatted as dd/mm/yyyy). I need to be able to plot cumulative totals on a graph like below but haven't been successul in making it work. Could someone please help me create a measure that will do this? Thanks

Graph.PNG

1 ACCEPTED SOLUTION
quantumudit
Super User
Super User

You can use the following DAX measure to get the desired result:

Cumulative Count = 
COUNTROWS (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Week] <= MAX ( 'Table'[Week] )
            && 'Table'[Year] = MAX ( 'Table'[Year] )
    )
)


I have created the "Year" calculated column using the following DAX formula:

Year = YEAR('Table'[date])

Here is the solution screenshot in Power BI:

quantumudit_0-1712914016488.png

Best Regards,
Udit

If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

 

 

View solution in original post

2 REPLIES 2
onedayover
Helper III
Helper III

Thanks quantumudit, that worked perfectly! I appreciate your help with this 🙂

quantumudit
Super User
Super User

You can use the following DAX measure to get the desired result:

Cumulative Count = 
COUNTROWS (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Week] <= MAX ( 'Table'[Week] )
            && 'Table'[Year] = MAX ( 'Table'[Year] )
    )
)


I have created the "Year" calculated column using the following DAX formula:

Year = YEAR('Table'[date])

Here is the solution screenshot in Power BI:

quantumudit_0-1712914016488.png

Best Regards,
Udit

If this post helps, please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

 

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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