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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors