cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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