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
LD1
Helper III
Helper III

Cumulative weeks

Hi everyone, 

 

I just want to figure it out how to cumulate the sum of Turnover by weeks please?

In other word, I would like to create this graph :

 

x = Weeks by one year

y = Turnover

 

But, what is the formula to create this cumulating turnover? 

 

Start date : it depend on the selection "Date" in the timeline

End date : Like below, it depend on the timeline

 

LD1_1-1701248515589.png

 

Here is the graph :

 

LD1_0-1701248407863.png

 

Thank you a lot for your answer and have a good day !

 

Lena

 

 

 

 

1 ACCEPTED SOLUTION
joaoribeiro
Kudo Kingpin
Kudo Kingpin

Hi @LD1 ,

 

For this you can check what are your first and last dates for each data point and then calculate the measure in the 'datesbetween'. Please check an example below that I created based on your scenario:

Cumulative Value = 
VAR _min_date = CALCULATE(MIN('Table Name'[Date]), REMOVEFILTERS('Table Name'[Week]))
VAR _last_date = MAX('Table Name'[Date])

RETURN
CALCULATE(
    SUM('Table Name'[Value]),
    DATESBETWEEN('Table Name'[Date], _min_date, _last_date),
    REMOVEFILTERS('Table Name'[Week])
)

 

joaoribeiro_0-1701250901136.png

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍

Thanks!

Best regards,
Joao Ribeiro

View solution in original post

2 REPLIES 2
LD1
Helper III
Helper III

Thank you a lot @joaoribeiro !

joaoribeiro
Kudo Kingpin
Kudo Kingpin

Hi @LD1 ,

 

For this you can check what are your first and last dates for each data point and then calculate the measure in the 'datesbetween'. Please check an example below that I created based on your scenario:

Cumulative Value = 
VAR _min_date = CALCULATE(MIN('Table Name'[Date]), REMOVEFILTERS('Table Name'[Week]))
VAR _last_date = MAX('Table Name'[Date])

RETURN
CALCULATE(
    SUM('Table Name'[Value]),
    DATESBETWEEN('Table Name'[Date], _min_date, _last_date),
    REMOVEFILTERS('Table Name'[Week])
)

 

joaoribeiro_0-1701250901136.png

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍

Thanks!

Best regards,
Joao Ribeiro

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.