Forum Discussion

Alvarjo's avatar
Alvarjo
New Member
3 years ago

Cumulative weekly kpis

Hi,

I am trying to get weekly cumulative traffic data for a chart  that I am creating. For that, I am using this formula:

Book 1_Cumulative.Traffic =
CALCULATE (
    SUM('DE Traffic Weekly_1'[Glance views]),
    FILTER(
    ALLSELECTED('DE Traffic Weekly_1'),
    'DE Traffic Weekly_1'[week post pubdate]<=max('DE Traffic Weekly_1'[week post pubdate])
    )
)  
 

As you can see in the following screenshot, it does the cumulative for the weeks it has data but then it adds the total cumulative number for that traffic KPI. there's only one filter used to filter that table (#1: Book 1_ASIN). The results highlighted in #2 are indeed doing as expected: cumulating the traffic week on week. What I don't understand is why the total traffic aggregated is showing up in #3 and #4. 

 

Not sure if this is coincidental but the error happens when there are negative numbers in the Week number (this is correct as it's relative to a release date and there can be pre-orders).

 

That "week number" is coming from a different table made out of this formula:

Weeks = GENERATESERIES(-50,1000)

 

This is the relationships created between the tables (the calendar table is not used for this precise exercise but for another chart):

 

 Thanks in advance for your help!

 
 

 

 

3 Replies