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

View all the Fabric Data Days sessions on demand. View schedule

Reply
itsranga
Helper I
Helper I

DAX Query Not working

Need to calculate  Parent ticket and child ticket hrs using DAX formula attached image for my requirement i tried multiple ways but its not working

itsranga_0-1761830627618.png

 

1 ACCEPTED SOLUTION
rohit1991
Super User
Super User

Hi @itsranga 

 

1. Create Measures:

Parent_Hrs = SUM(ParentTickets[TotalHrs])
Child_Hrs = SUM(ChildTickets[TotalHrs])
Total_By_Ticket =
VAR _Parent =
    CALCULATE(
        SUM(ParentTickets[TotalHrs]),
        TREATAS(VALUES(ParentTickets[ParentTicketID]), ParentTickets[ParentTicketID])
    )
VAR _Child =
    CALCULATE(
        SUM(ChildTickets[TotalHrs]),
        TREATAS(VALUES(ParentTickets[ParentTicketID]), ChildTickets[ParentTicketID])
    )
RETURN
_Parent + _Child

 

2. Outcome:

rohit1991_1-1761834341048.png

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

5 REPLIES 5
v-karpurapud
Community Support
Community Support

Hi @itsranga 

We have not received a response from you regarding the query and were following up to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

Thank You.

v-karpurapud
Community Support
Community Support

Hi @itsranga 

Thanks for reaching out to the Microsoft fabric community forum. 

 

I would like to thank you @GeraldGEmerick  and @rohit1991  for your active participation in the community forum and for the valuable solutions you have shared. Your contributions have a significant impact.

I hope the information provided will assist you in resolving the issue. If you have further questions or require additional assistance, please do not hesitate to reach out. We are here to support you.

 

Best Regards, 
Community Support Team.

rohit1991
Super User
Super User

Hi @itsranga 

 

1. Create Measures:

Parent_Hrs = SUM(ParentTickets[TotalHrs])
Child_Hrs = SUM(ChildTickets[TotalHrs])
Total_By_Ticket =
VAR _Parent =
    CALCULATE(
        SUM(ParentTickets[TotalHrs]),
        TREATAS(VALUES(ParentTickets[ParentTicketID]), ParentTickets[ParentTicketID])
    )
VAR _Child =
    CALCULATE(
        SUM(ChildTickets[TotalHrs]),
        TREATAS(VALUES(ParentTickets[ParentTicketID]), ChildTickets[ParentTicketID])
    )
RETURN
_Parent + _Child

 

2. Outcome:

rohit1991_1-1761834341048.png

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
itsranga
Helper I
Helper I

@GeraldGEmerick   realtionship is there but diifrent column many to many replationship

GeraldGEmerick
Solution Sage
Solution Sage

@itsranga How is the Parent ticket tied to the Child Ticket? Is there a table somewhere that defines this relationship or is the data you have exatly what is shown?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors