cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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...

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

1 ACCEPTED SOLUTION
Continued Contributor

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:

Best Regards,
Udit

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

2 REPLIES 2
Helper III

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

Continued Contributor

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:

Best Regards,
Udit

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.