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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Folio
Regular Visitor

Cumulative Difference with Categorical Variables

I am trying to create a clustered bar chart showing count of closed and open tickets each month. That's the easy part. I want to add a line to the chart showing the cumulative difference between the amount of closed and open tickets. I've looked through the multiple posts on here concerning cumulative differences, but they all deal with values like sales and revenue whereas my data is categorical. 

 Capture.PNG

To be more clear with the cumulative part, I want to add up the amount of open tickets since the beginning of time in the data set. Then as time moves forward with each day that tickets are opened and closed, they are added to the cumulative total (open) or subtracted from the cumulative total (closed). It's complicated because it depends on that condition. Any help would be much appreciated. 

 

Here's a screen of my data. In the Ticket_Status column, it either has Closed or Open.

Capture.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Folio,

 

I'd like to suggest you use below formula to expand your original table, then you can direct use detail date range table to create visuals.

 

Expand Table = 
VAR _calendar =
    CALENDAR ( MINX ( Sheet1, [Created_Dt] ), MAXX ( Sheet1, [Resolved_Dt] ) )
RETURN
    SELECTCOLUMNS (
        FILTER (
            CROSSJOIN ( Sheet1, _calendar ),
            [Date] >= [Created_Dt]
                && [Date] <= [Resolved_Dt]
        ),
        "Ticket Id", [Ticket Id],
        "Ticket Status", [Ticket Status],
        "Date", [Date]
    )

7.PNG

 

Regards,

Xiaoxin Sheng

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Folio,

 

I'd like to suggest you use below formula to expand your original table, then you can direct use detail date range table to create visuals.

 

Expand Table = 
VAR _calendar =
    CALENDAR ( MINX ( Sheet1, [Created_Dt] ), MAXX ( Sheet1, [Resolved_Dt] ) )
RETURN
    SELECTCOLUMNS (
        FILTER (
            CROSSJOIN ( Sheet1, _calendar ),
            [Date] >= [Created_Dt]
                && [Date] <= [Resolved_Dt]
        ),
        "Ticket Id", [Ticket Id],
        "Ticket Status", [Ticket Status],
        "Date", [Date]
    )

7.PNG

 

Regards,

Xiaoxin Sheng

 

Johannesvd
Helper I
Helper I

Hi @Foliodoes something like this this solve your problem:

 

Measure =
CALCULATE(
 countrows(table);
 FILTER(
  ALLSELECTED('table'[Created_dt]);
  ISONORAFTER('table'[Created_dt]; 'table'[Created_dt]; DESC)
         ); 'table'Ticket_status" ="open"))

Ashish_Mathur
Super User
Super User

Hi,

 

In a simple Excel file, please show the result you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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