I'm new to Power Bi.
I want to calculate Outstanding Jira Tickets and group the tickets yearly+Monthly. I did it using excel.
There are 7 columns(ticketID,CreatedDate,ResolvedDate,Createdyear,CreatedMonth,ResolvedYear and ResolvedMonth). What I want to do is calculate outstanding tickets for each year and month(EX: for 2021 Jan, How many outstanding tickets?).
The calculation mechanism is explained below.
To calculate Outstanding ticekts for eachyear(X) monthly(Y) wise,below logic is used.
A = All not resolved tickets(tickets with null value for resolvedDate)
B = Resolved null and CreatedYear = X and CreatedMonth >Y
C=ResolvedYear= X and ResolvedMonth>Yand CreatedYear<X
D= ResolvedYear = X and ResolvedMonth>Y and Createdyear= X and CreatedMonth<=Y
Outstanding tickets for Year(X) AND Month(Y)= A-B+C+D
Example:
Lets say if i want to calculate outstanding ticekts for 2022 May, then i need to find using below conditions.
A= All not resolved tickets(tickets with null value for resolvedDate)
B=Resolved null and CreatedYear 2022 and createdMonth>May
C=ResolvedYear 2022 and ResolvedMonth>May and CreatedYear<2022
D= ResolvedYear 2022 and ResolvedMonth>May and Createdyear 2022 and CreatedMonth<=May
Outstanding tickets for 2022 May= A-B+C+D
Please check the excel file using the attached link.
Corresponding excel query:
Used Excel Query=
=COUNTIF(ResolvedDate,"")-COUNTIFS(ResolvedDate,"",Created_Year,G2,Created_Month,CONCAT(">",MONTH(DATEVALUE(H2&" 1"))))+COUNTIFS(Resolved_Year,G2,Resolved_Month,CONCAT(">",MONTH(DATEVALUE(H2&" 1"))),Created_Year,CONCAT("<",G2))+COUNTIFS(Resolved_Year,G2,Resolved_Month,CONCAT(">",MONTH(DATEVALUE(H2&" 1"))),Created_Year,G2,Created_Month,CONCAT("<=",MONTH(DATEVALUE(H2&" 1"))))
What i tried with PowerBI:
So now i want to do this in PowerBI,
i get the data from excel and groupby using year and month using count rows, my idea is to change the groupby code in applied steps.
= Table.Group(#"Changed Type", {"CreatedYear", "CreatedMonth"}, {{"Count", each Table.RowCount(_), Int64.Type}})
but the problem is I don't know how to get summation and subtraction like i did it in powerBI.
Can someone please provide detailed instructions on creating columns and calculations or measures with formulas?




