Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Cumulative line graph - one measure totalling incorrectly

Hello all,
First time post so hopefully I am including everything I need to be clear.

 

I am trying to show the number of 'created issues' against number of 'closed issues' along a date axis (beginning of a new week (Monday to Sunday)).  I would like the cumulative measure to calculate all issues created between 1st August 2023 to 8th January 2024 and not only the relative timeframe of the visual (last 12 weeks) which i do want for the bars.  The report page is filtered to exclude issues created pre 1st August 2003 and post 8th January 2024.

Created Issues, Closed Issues and Created Issues (cumulative) are all coming through perfectly.  The problem I am having is the Closed Issues (cumulative) line which is stepping up correctly but is totalling to the total amount of the created issues which is incorrect.  In the attached example, the cumulative line should end up as 98 not 552.

 

 

I have two inactive relationships between my date table and the created at and closed at dates in my data table.

 

 

The measures I am using are as follows:

# Created Issues by Date =
CALCULATE(
    COUNTA('issues_issues'[created_at]),
    Filter('issues_issues',
    COUNTROWS(FILTER(VALUES('Date'),
    'issues_issues'[created_at]= 'Date'[Date]))
>0)
)
 
# Closed Issues by Date =
CALCULATE(
    COUNTA('issues_issues'[created_at]),
    Filter('issues_issues',
    COUNTROWS(FILTER(VALUES('Date'),
    'issues_issues'[closed_at]= 'Date'[Date]))
>0)
)
 
# Created Issues by Start of Week (cumulative) =
CALCULATE(
    [# Created Issues by Date],
    FILTER(
        ALL('Date'[Start of Week (Monday)]),
        ISONORAFTER('Date'[Start of Week (Monday)], MAX('Date'[Start of Week (Monday)]), DESC)
    )
)
 
# Closed Issues by Start of Week (cumulative) =
CALCULATE(
    [# Closed Issues by Date],
    FILTER(
        ALL('Date'[Start of Week (Monday)]),
        ISONORAFTER('Date'[Start of Week (Monday)], MAX('Date'[Start of Week (Monday)]), DESC)
    )
)
 
I can't identify where I am going wrong.  Any help would be much appreciated.
 
Many thanks.

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Thank you - I have managed to resolve the issue.  I hadn't excluded the blank closed items in the measure.

2 Replies