cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper III

## Averagex vs Division (which one for calculating Tickets per Working Day)

Hello,

I'm sorry if it's a stupid question, I would like to calculate the number of tickets per working day.

Should I be using Averagex(Working_Days, Tickets) or Divide (Tickets, Working_Days)? and Why?

Thank you so much

Simon

1 ACCEPTED SOLUTION
Super User

Hello Simon,

Quite an interesting question actually 🙂

The "correct" method to use would depend on your exact requirements.

The key points to be aware of (I'm making some assumptions about how you've defined Working_Days and Tickets):

• AVERAGEX disregards any rows of the table supplied in the 1st argument where the 2nd argument is blank. In your case, this would have the effect of dividing Tickets by the count of working days where Tickets is nonblank.
• The DIVIDE method would include all Working Days regardless of the values of Tickets

Personally, I prefer to use the DIVIDE method as I would generally want to count all Working Days regardless of whether Tickets has a nonblank value on any given date.

To illustrate, I have attached a small PBIX example. For this example, let's assume that Working Days are Mon-Fri.

The two important measures to illustrate the difference are:

``````# Tickets per Working Day AVERAGEX =
AVERAGEX (
FILTER ( 'Date', 'Date'[Work Day] = 1 ),
[# Tickets]
)``````
``````# Tickets per Working Day DIVIDE =
DIVIDE ( [# Tickets], [Working Days Count] )``````

In this example, over the first 7 days of January 2023:

• # Tickets = 17
• Number of working days on which # Tickets is nonblank = 4 (Mon, Wed, Thu, Fri)
• Number of working days total = 5 (Mon-Fri)
• AVERAGEX measure returns 17 / 4 = 4.25
• DIVIDE measure returns 17 / 5 = 3.40

Regards

Owen Auger
Blog
2 REPLIES 2
Super User

Hello Simon,

Quite an interesting question actually 🙂

The "correct" method to use would depend on your exact requirements.

The key points to be aware of (I'm making some assumptions about how you've defined Working_Days and Tickets):

• AVERAGEX disregards any rows of the table supplied in the 1st argument where the 2nd argument is blank. In your case, this would have the effect of dividing Tickets by the count of working days where Tickets is nonblank.
• The DIVIDE method would include all Working Days regardless of the values of Tickets

Personally, I prefer to use the DIVIDE method as I would generally want to count all Working Days regardless of whether Tickets has a nonblank value on any given date.

To illustrate, I have attached a small PBIX example. For this example, let's assume that Working Days are Mon-Fri.

The two important measures to illustrate the difference are:

``````# Tickets per Working Day AVERAGEX =
AVERAGEX (
FILTER ( 'Date', 'Date'[Work Day] = 1 ),
[# Tickets]
)``````
``````# Tickets per Working Day DIVIDE =
DIVIDE ( [# Tickets], [Working Days Count] )``````

In this example, over the first 7 days of January 2023:

• # Tickets = 17
• Number of working days on which # Tickets is nonblank = 4 (Mon, Wed, Thu, Fri)
• Number of working days total = 5 (Mon-Fri)
• AVERAGEX measure returns 17 / 4 = 4.25
• DIVIDE measure returns 17 / 5 = 3.40

Regards

Owen Auger
Blog
Helper III

WOW @OwenAuger , a great description for how it works, I really appreciate it so much.

Regards, Simon

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors