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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

New Column or Measure required to display totals

Hi, I have two tables as below. Parent Tickets and Child tickets. From the below data Parent ticket PT2 has incorrect status. That is when all the child tickets are completed, the parent ticket cannot be in Active state. I am looking for count of parent tickets which are still active when their child tickets are in completed status. 


Parent Tickets data

Service NameParent Ticket NumberTicket Status
IT Service 1

PT1

Active
IT Service 2PT2Active
IT Service 3PT3Active
IT Service 1PT4Closed

 

Child Tickets Data

Parent Ticket NumberChild Ticket NumberChild Ticket Status
PT1CT1InProgress
PT1CT2Completed
PT1CT3Planned
PT1CT4Completed
PT2CT5Completed
PT2CT6Completed
PT2CT7Completed
PT3CT8InProgress
PT4CT9Completed

 

I also have a Visual like below except the last column. I am looking for the highlighted column.

Service NameTotal no of Parent ticketsTotal no of child ticketsTotal no of incomplete child tktsTotal parent tickets with incorrect status
IT Service 12520
IT Service 21401
IT Service 31110

 

My measure are as below for this visual:
Total no of incomplete child tickets = Calculate(DISTINCCOUNT(ChildTickets[Child Ticket Number]), filter(ChildTicket, ChildTickets[Status] in {InProgress, Planned}))

 

Please help me to get the required out as in highlighted column above

5 REPLIES 5
SolomonovAnton
Solution Supplier
Solution Supplier

hello ! 

 

I hope it will help you 

 

Total no of incomplete child tickets =

var _count = Calculate(DISTINCCOUNT(ChildTickets[Child Ticket Number]), filter(ChildTicket, ChildTickets[Status] in

{InProgress, Planned}))
var _complete = if (countrows(values('Child Tickets Data'[ Child Ticket Status])) =1 && isblank(filter('Child Tickets Data','Child Tickets Data'[ Child Ticket Status] = 'Completed')),true(),false())

var _result = if (and(min('Parent Tickets data'[Ticket Status])='Active', _complete), _count,0)

return _result

 

If my message helped solve your issue, please mark it as Resolved! If it was helpful, consider giving it a Kudos!
Anonymous
Not applicable

Hi @SolomonovAnton , thanks for quick response. I am getting an error as below:
"The expression refers to multiple columns. multiple columns cannot be converted to scalar value"

I did bit changes in measure 

please check 

 

Total no of incomplete child tickets = 

var _count = Calculate(COUNT('Child Tickets Data'[Child Ticket Number]),filter('Child Tickets Data', 'Child Tickets Data'[Child Ticket Status] in{"Completed"}))
var _complete = if (countrows(filter(VALUES('Child Tickets Data'[Child Ticket Status]),'Child Tickets Data'[Child Ticket Status] = "Completed"))=1,true(),false())

var _result = if (and(min('Parent Tickets data'[Ticket Status])="Active", _complete), _count,0)

return _result

 

I get follow result 

SolomonovAnton_0-1658844392617.png

 

If my message helped solve your issue, please mark it as Resolved! If it was helpful, consider giving it a Kudos!
Anonymous
Not applicable

Hi @SolomonovAnton , thanks again for quick response. The error is gone. But my question is different. I am looking for total number of parent tickets which have incorrect status. My expected output is shown in the last column ''Total parent tickets with incorrect status" of the  table below. Can you please help if it is possible. Thanks

Service NameTotal no of Parent ticketsTotal no of child ticketsTotal no of incomplete child tktsTotal parent tickets with incorrect status
IT Service 12520
IT Service 21401
IT Service 31110

try it 

 

Total no of incomplete child tickets = 

var _count = Calculate(COUNT('Parent Tickets data'[Parent Ticket Number]),filter('Child Tickets Data', 'Child Tickets Data'[Child Ticket Status] in{"Completed"}))
var _complete = if (and(countrows(VALUES('Child Tickets Data'[Child Ticket Status]))=1,min('Child Tickets Data'[Child Ticket Status])= "Completed"),true(),false())

var _result = if (and(min('Parent Tickets data'[Ticket Status])="Active", _complete), _count,0)

return _result

 

it's variant look like what you expect

SolomonovAnton_0-1658909213514.png

if I answered at your question please mark topic at resolved 🙂




If my message helped solve your issue, please mark it as Resolved! If it was helpful, consider giving it a Kudos!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.