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
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
v-shex-msft
Community Support
Community Support

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

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

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

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
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
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.