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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
PS_78
Helper II
Helper II

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 

 

PS_78_0-1719502714214.png

Thanks,

Phani

1 ACCEPTED SOLUTION

lbendlin_0-1719594344541.png

% 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]))

View solution in original post

8 REPLIES 8
lbendlin
Super User
Super User

lbendlin_0-1719531002935.png

 

Thanks @lbendlin for your response. I do not want to bring in "Incidents" and "# of tickets" into summarized table. I just want to do the actual calculation and use it in the visual.

 

Thanks,

Phani

I thought that  is what I provided. Please clarify what you are trying to achieve.

Thanks for the quick response again. The solution you suggested is getting "Incidents" and "Total # of Tickets" in the summarized table and created measure within summarized table to calculate "% Bug Fixes_Msr". What I am trying to achieve is calculating "% Bug Fixes" within Summarized table itself.

 

In addition, the summarized table, "% Bug Fixes" is yielding incorrect ticket count. For example, Week W01 has only 7 bugs and 24 total tickets where as summarized table doubles it.

 

PS_78_0-1719592773175.png

Thanks,

Phani

lbendlin_0-1719594344541.png

% 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]))

Thanks a lot @lbendlin . This sounds great. I will accept this as a solution. But, is there any way, I can skip "Incidents" and "# of Tickets" from returning? I mean to ask, can we put count of Incidents / # of tickets in separate variables and use them in DIVIDE?

 

Thanks,

Phani

Do you maybe need a measure instead of a calculated table?

Hello @lbendlin  - The main table I have is raw data and I will have to generate multiple metrics (summarizing at week level) based on it, show each of the metric in matrix visual, combine it with a different dataset to get target into the calculated table, do the color code based on target Vs actual values. Hence I am going with calculated table.

Thanks,

Phani

 

Thanks,

Phani

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.