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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
lavlyn78
Frequent Visitor

Calculate 30 day change for open and closed tickets

lavlyn78_1-1716963720768.png

Hi, i am fairly new to DAX and Power BI and i am trying to calculate using DAX formula on the 30 days change of Count of Red and Yellow categories.

 

The first column is a calculated measure of current/today day count:

 
Count of CategoriesRed and Yellow =
CALCULATE(
    COUNTA('[Age Categories]), '[Age Categories]
        IN { "Greater than 90 less than 180 days", "Greater than 180 days" }
 
I would like to find out the count of tickets 30 days ago and calculate the % change.
 
Last 30 days opened = CALCULATE([Count of CategoriesRed and Yellow], KEEPFILTERS([opened_on] > NOW() - 30))
 
Last 30 days Closed = CALCULATE([Count of CategoriesRed and Yellow], KEEPFILTERS([Final Terminated Date] > NOW() - 30))
Cannot be that the 30 days ago Closed value is blank. Am i missing somthing here?
 
Change = CALCULATE(([Count of CategoriesRed and Yellow]-[Last 30 days opened]-[Last 30 days Closed]))
 
%Change = ([Count of CategoriesRed and Yellow]-[Change])/[Count of CategoriesRed and Yellow]
 
Not even sure if the DAX forumla or my mathematical makes sense.
Between these 30 days, there will be tickets opening and closing.
How can i capture this data accurately?
Can someone enlightened me? Thanks.
 
3 REPLIES 3
amitchandak
Super User
Super User

@lavlyn78,

if you opened and active, not closed in last 30day, you can have measure like

 

Active Last 30 days opened = CALCULATE([Count of CategoriesRed and Yellow], [opened_on] > (NOW() - 30) && Final Terminated Date] > NOW() )

 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Thank you for your reply. I have added your formula but it still gives me a blank value. 

I have a sample pbix file, how to i attach it here? I have attached the table instead 

 

IndexstatusPrioritycreated_onFinal Terminated DateState
1RCritical17/5/202424/5/2024Closed
2RCritical29/4/20241/5/2024Closed
3RCritical29/4/20241/5/2024Closed
4RCritical26/4/202428/5/2024Closed
5RCritical29/4/20241/5/2024Closed
6RCritical29/4/20241/5/2024Closed
7RCritical2/5/20242/5/2024Closed
8VMedium1/5/20241/5/2024Closed
9RCritical8/5/202414/5/2024Closed
10RCritical21/4/202413/5/2024Closed
11RCritical16/5/202421/5/2024Closed
12VMedium17/5/202422/5/2024Closed
13RCritical29/4/20241/5/2024Closed
14RCritical8/5/20249/5/2024Closed
15RCritical14/4/202416/4/2024Closed
16VMedium15/4/202413/5/2024Closed
17RCritical24/5/202427/5/2024Closed
18RCritical19/4/202426/4/2024Closed
19VMedium11/5/202413/5/2024Closed
20RCritical2/5/20246/5/2024Closed
21RCritical21/5/202423/5/2024Closed
22RCritical7/5/202428/5/2024Closed
23RCritical3/5/20248/5/2024Closed
24RCritical29/4/20241/5/2024Closed
25RCritical25/4/202426/4/2024Closed
26RCritical29/4/20241/5/2024Closed
27RCritical20/4/202428/5/2024Closed
28RCritical24/5/202428/5/2024Closed
29VMedium23/5/202426/5/2024Closed
30VMedium22/5/202424/5/2024Closed
31RCritical29/4/20241/5/2024Closed
32RCritical2/5/202427/5/2024Closed
33RCritical17/5/202417/5/2024Closed
34RCritical20/4/202428/5/2024Closed
35RCritical20/4/202428/5/2024Closed
36RCritical25/4/202428/5/2024Closed
37RCritical25/4/202428/5/2024Closed
38RCritical28/5/202428/5/2024Closed
39RCritical28/5/202428/5/2024Closed
40RCritical17/4/202422/4/2024Closed
41MMedium2/5/202428/5/2024Closed
42RCritical17/5/202421/5/2024Closed
43RCritical21/5/202421/5/2024Closed
44RCritical29/4/20241/5/2024Closed
45RCritical29/4/20241/5/2024Closed
46NMedium13/5/2024nullOpen
47AHigh30/4/2024nullOpen
48NMedium15/4/2024nullOpen
49NMedium10/5/2024nullOpen
50AHigh17/4/2024nullOpen
51AHigh22/5/2024nullOpen
52AHigh9/5/2024nullOpen
53AHigh22/5/2024nullOpen
54AHigh17/4/2024nullOpen
55NMedium13/5/2024nullOpen
56AHigh17/5/2024nullOpen
57NMedium22/5/2024nullOpen
58NMedium15/4/2024nullOpen
59OHigh30/4/2024nullOpen
60NMedium28/5/2024nullOpen
61AHigh30/4/2024nullOpen
62NMedium28/5/2024nullOpen
63NMedium28/5/2024nullOpen
64NMedium28/5/2024nullOpen
65NMedium28/5/2024nullOpen
66NMedium28/5/2024nullOpen
67NMedium28/5/2024nullOpen
68NMedium28/5/2024nullOpen
69NMedium28/5/2024nullOpen
70NMedium28/5/2024nullOpen
71NMedium28/5/2024nullOpen
72NMedium28/5/2024nullOpen
73NMedium28/5/2024nullOpen
74NMedium28/5/2024nullOpen
75NMedium28/5/2024nullOpen
76NMedium28/5/2024nullOpen
77NMedium28/5/2024nullOpen
78NMedium28/5/2024nullOpen
79NMedium28/5/2024nullOpen
80NMedium28/5/2024nullOpen
81NMedium28/5/2024nullOpen
82AHigh17/4/2024nullOpen
83NMedium15/4/2024nullOpen
84NMedium15/4/2024nullOpen
85AHigh30/4/2024nullOpen
86AHigh24/5/2024nullOpen
87NMedium28/5/2024nullOpen
88NMedium27/5/2024nullOpen
89AHigh30/4/2024nullOpen
90NMedium24/5/2024nullOpen
91NMedium26/4/2024nullOpen
92AHigh22/5/2024nullOpen
93AHigh22/5/2024nullOpen
94NMedium22/5/2024nullOpen
95AHigh16/4/2024nullOpen
96NMedium13/5/2024nullOpen
97NMedium22/5/2024nullOpen
98AHigh22/5/2024nullOpen
99HMedium1/5/2024nullOpen
100PMedium23/5/2024nullOpen
101AHigh23/5/2024nullOpen
102AHigh22/5/2024nullOpen
103NMedium8/5/2024nullOpen
104AHigh22/5/2024nullOpen
105NMedium22/5/2024nullOpen
106AHigh22/5/2024nullOpen
107AHigh22/5/2024nullOpen
108AHigh22/5/2024nullOpen
109AHigh22/5/2024nullOpen
110AHigh22/5/2024nullOpen
111NMedium22/5/2024nullOpen
112AHigh22/5/2024nullOpen
113NMedium22/5/2024nullOpen
114AHigh22/5/2024nullOpen
115AHigh22/5/2024nullOpen
116AHigh22/5/2024nullOpen
117NMedium22/5/2024nullOpen
118NMedium22/5/2024nullOpen
119NMedium22/5/2024nullOpen
120AHigh22/5/2024nullOpen
121NMedium22/5/2024nullOpen
122AHigh22/5/2024nullOpen
123AHigh22/5/2024nullOpen
124NMedium13/5/2024nullOpen
125AHigh22/5/2024nullOpen
126AHigh14/5/2024nullOpen
127NMedium28/5/2024nullOpen
128HMedium1/5/2024nullOpen
129AHigh4/5/2024nullOpen
130NMedium22/5/2024nullOpen
131AHigh22/5/2024nullOpen
132AHigh22/5/2024nullOpen
133AHigh22/5/2024nullOpen
134AHigh22/5/2024nullOpen
135NMedium27/4/2024nullOpen
136AHigh16/4/2024nullOpen
137NMedium22/5/2024nullOpen
138AHigh22/5/2024nullOpen
139NMedium22/5/2024nullOpen
140NMedium22/5/2024nullOpen
141AHigh22/5/2024nullOpen
142PMedium23/5/2024nullOpen
143NMedium22/5/2024nullOpen
144AHigh22/5/2024nullOpen
145AHigh22/5/2024nullOpen
146NMedium22/5/2024nullOpen
147AHigh24/5/2024nullOpen
148AHigh22/5/2024nullOpen
149AHigh17/4/2024nullOpen
150AHigh22/5/2024nullOpen
151NMedium22/5/2024nullOpen
152NMedium22/5/2024nullOpen
153AHigh22/5/2024nullOpen
154AHigh22/5/2024nullOpen
155NMedium11/5/2024nullOpen
156NMedium22/5/2024nullOpen
157AHigh22/5/2024nullOpen
158NMedium28/5/2024nullOpen

 

lavlyn78_0-1717125914972.png

Here are some of the columns i have created as well:

Age = DATEDIFF([created_on],TODAY(),Day)
 
Group the age categories like "More than 30 days", "Between 10 to 30 days" and "Less than 30 days"
 
Sum only the Critical and High tickets and more than 10 days:
 
Count of Critical and High =
CALCULATE(
    COUNTA('Table'[Age Categories]),
    'Table'[Age Categories]
        IN { "Between 10 to 30 days", "More than 30 days" }
 
As mentioned earlier, i need to find the count of tickets in the last 30 days.
Then the % change.
Thanks for your help again.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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