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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Oaabwen42
Frequent Visitor

Power BI Doing Division Incorrectly

Hi everyone,

 

I'm trying to make a very simple "average number of support tickets per month" calculation. I have the following:

 
Avg Tickets Per Month =
DIVIDE(
    COUNTROWS(Table),
    DISTINCTCOUNT(Table[YearMonth]), 0)
 
However, the number it returned, 4.33, didn't seem right. I split the COUNTROWS and DISTINCTCOUNT functions into their own measures to test:
 
Tickets = COUNTROWS(Table)
Months = DISTINCTCOUNT(Table[YearMonth])
 
Tickets returned 52, and Months returned 9. So Avg Tickets Per Month should be 52 / 9 = 5.77
 
I also tried the following and got 4.33 again:
 
Avg Tickets Per Month = DIVIDE([Tickets], [Months], 0)
 
What is going on??? I don't see why it would return the wrong number
1 ACCEPTED SOLUTION

@Oaabwen42 , Make sure there is no visual level filter on that card

Try this measure for count distinct

countrows(values(Table[YearMonth]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
powerbiexpert22
Impactful Individual
Impactful Individual

Hi @Oaabwen42 ,

are you using table or card visual ? would you please share sample pbix or sample data?

Hi,

I'm using a card visual. I can't share the sample pbix or data, but you can see what's happening in this screenshot: 

Oaabwen42_0-1735922981527.png

Tickets = 52, Months = 9, therefore DIVIDE(52, 9, 0) = 5.77, but it returns the wrong number.

@Oaabwen42 , Make sure there is no visual level filter on that card

Try this measure for count distinct

countrows(values(Table[YearMonth]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.