Skip to main content
cancel
Showing results for 
Search instead 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

Reply
y5famfnatudu
Helper III
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
OwenAuger
Super User
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.

OwenAuger_1-1688295084327.png

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
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
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.

OwenAuger_1-1688295084327.png

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
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

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

Regards, Simon

Helpful resources

Announcements
Fabric Community Conference

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.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

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