Forum Discussion

PS_78's avatar
PS_78
Helper II
2 years ago
Solved

Issue with Divide in Summarize table

Hello - I am running into an issue with DIVIDE in Summarization. I have a table with list of tickets and I need to create a summarize table (creating summarize table as I have to do it for multiple measures) and calculate % of Bug fixes. For this, I am using DIVIDE function in SUMMARIZE table DAX function. This results in incorrect result. However, if I bring the numerator and denominator into the summarize table and create another measure using DIVIDE, it works fine. I am attaching herewith the sample PBIX file. Request your help to fix the formula in SUMMARIZE.

 

PBIX File - DIVIDE Issue with SUMMARIZE table 

 

Thanks,

Phani

  • % Bug Fixes = 
    var a = ADDCOLUMNS(SUMMARIZE (
        Tickets,
        [Created Year],
        [Created Week]),
       "Incidents",
            CALCULATE(COUNTROWS (Tickets),Tickets[Issue Type] = "Incident"),
        "# of Tickets",
            CALCULATE(COUNTROWS (Tickets),Tickets[Issue Type] in { "Incident", "Service request"})
            )
    return ADDCOLUMNS(a,"% Bug Fixes_Msr",DIVIDE([Incidents],[# of Tickets]))

8 Replies