Forum Discussion
Backlog issue when filter by Date
- Anonymous7 years ago
HI yanx1990 ,
You can consider to add all function to ignore all filters to get unfiltered records, then you can use condition filters on these records to get specific range backlog:
Backlog Tickets = VAR currDate = MAX ( 'Fact_Incoming_Closed'[Date] ) VAR Incoming_Tickets = CALCULATE ( COUNT ( Fact_Incoming_Closed[Request ID] ), FILTER ( ALL ( Fact_Incoming_Closed ), Fact_Incoming_Closed[Date] <= currDate && Fact_Incoming_Closed[Status] = "Incoming" ) ) VAR Closed_Tickets = CALCULATE ( COUNT ( Fact_Incoming_Closed[Request ID] ), FILTER ( ALL ( Fact_Incoming_Closed ), Fact_Incoming_Closed[Date] <= currDate && Fact_Incoming_Closed[Status] = "Closed" ) ) RETURN Incoming_Tickets - Closed_TicketsRegards,
Xiaoxin Sheng
Hello,
Anonymous Many thanks for your answer. Here's the PBIX and CSV sample data file.
Kind regards,
Yannick
HI yanx1990 ,
You can consider to add all function to ignore all filters to get unfiltered records, then you can use condition filters on these records to get specific range backlog:
Backlog Tickets =
VAR currDate =
MAX ( 'Fact_Incoming_Closed'[Date] )
VAR Incoming_Tickets =
CALCULATE (
COUNT ( Fact_Incoming_Closed[Request ID] ),
FILTER (
ALL ( Fact_Incoming_Closed ),
Fact_Incoming_Closed[Date] <= currDate
&& Fact_Incoming_Closed[Status] = "Incoming"
)
)
VAR Closed_Tickets =
CALCULATE (
COUNT ( Fact_Incoming_Closed[Request ID] ),
FILTER (
ALL ( Fact_Incoming_Closed ),
Fact_Incoming_Closed[Date] <= currDate
&& Fact_Incoming_Closed[Status] = "Closed"
)
)
RETURN
Incoming_Tickets - Closed_Tickets
Regards,
Xiaoxin Sheng
- yanx19907 years agoFrequent Visitor
Hi Anonymous ,
It works like a charm !! Tested on my production database (the CSV was just a sample) and it's just what I expected to do.
Again many many thanks and have a wonderful day :smileyvery-happy:
Yannick
- sreeni6 years agoFrequent Visitor
Hi Xiaoxin Sheng,
Anonymous wrote:HI yanx1990 ,
You can consider to add all function to ignore all filters to get unfiltered records, then you can use condition filters on these records to get specific range backlog:
Backlog Tickets = VAR currDate = MAX ( 'Fact_Incoming_Closed'[Date] ) VAR Incoming_Tickets = CALCULATE ( COUNT ( Fact_Incoming_Closed[Request ID] ), FILTER ( ALL ( Fact_Incoming_Closed ), Fact_Incoming_Closed[Date] <= currDate && Fact_Incoming_Closed[Status] = "Incoming" ) ) VAR Closed_Tickets = CALCULATE ( COUNT ( Fact_Incoming_Closed[Request ID] ), FILTER ( ALL ( Fact_Incoming_Closed ), Fact_Incoming_Closed[Date] <= currDate && Fact_Incoming_Closed[Status] = "Closed" ) ) RETURN Incoming_Tickets - Closed_TicketsRegards,
Xiaoxin Sheng
Anonymous wrote:HI yanx1990 ,
You can consider to add all function to ignore all filters to get unfiltered records, then you can use condition filters on these records to get specific range backlog:
Backlog Tickets = VAR currDate = MAX ( 'Fact_Incoming_Closed'[Date] ) VAR Incoming_Tickets = CALCULATE ( COUNT ( Fact_Incoming_Closed[Request ID] ), FILTER ( ALL ( Fact_Incoming_Closed ), Fact_Incoming_Closed[Date] <= currDate && Fact_Incoming_Closed[Status] = "Incoming" ) ) VAR Closed_Tickets = CALCULATE ( COUNT ( Fact_Incoming_Closed[Request ID] ), FILTER ( ALL ( Fact_Incoming_Closed ), Fact_Incoming_Closed[Date] <= currDate && Fact_Incoming_Closed[Status] = "Closed" ) ) RETURN Incoming_Tickets - Closed_TicketsRegards,
Xiaoxin Sheng
Anonymous wrote:HI yanx1990 ,
You can consider to add all function to ignore all filters to get unfiltered records, then you can use condition filters on these records to get specific range backlog:
Backlog Tickets = VAR currDate = MAX ( 'Fact_Incoming_Closed'[Date] ) VAR Incoming_Tickets = CALCULATE ( COUNT ( Fact_Incoming_Closed[Request ID] ), FILTER ( ALL ( Fact_Incoming_Closed ), Fact_Incoming_Closed[Date] <= currDate && Fact_Incoming_Closed[Status] = "Incoming" ) ) VAR Closed_Tickets = CALCULATE ( COUNT ( Fact_Incoming_Closed[Request ID] ), FILTER ( ALL ( Fact_Incoming_Closed ), Fact_Incoming_Closed[Date] <= currDate && Fact_Incoming_Closed[Status] = "Closed" ) ) RETURN Incoming_Tickets - Closed_TicketsRegards,
Xiaoxin Sheng