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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JohnW
Helper III
Helper III

Average number at a given time

Hi everyone,

 

I am still kind of new to Power BI so hopefully this is an easy one to help with.

 

I am trying to get the average number of swipe counts by date to show upper management what they can expect for an average number of customers per day.  The problem is that when I try to change the value from SUM to AVERAGE the values flatline all at 1.  It does this because for each customer it counts 1 swipe.  So when it tries to get the average it's just counting all the swipes and dividing by the number of them which would ultimatley be 1.

 

So my question would be is there a way within Power BI that would let me be able to get the right average for each day without it getting an average of 1?

 

Thanks!

 

With SUM functionWith SUM function

 

JohnW_0-1594224971126.png

 

1 ACCEPTED SOLUTION

@JohnW , this seem like distinctcount

 

AverageX(Values(Table[Date]),distinctcount(Table[ID]))

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@JohnW , Try like

AverageX(Values(Table[Date]),sum(Table[Swipe]))

 

In case you already have a measure

AverageX(Values(Table[Date]),[Swipe count])

Thank you for the reply @amitchandak,  

 

I tried both of your suggestions and the results are the same as when I have the Swipe Counts set to SUM.  

 

JohnW_0-1594226339547.png

 

@JohnW ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@amitchandak,

Is this what you are looking for for the sample data and output? 

 

Sample Table

IDSwipe Count Date
119/12/2019
119/12/2019
419/12/2019
419/12/2019
519/12/2019
519/12/2019

Output Table

Average Swipe CountDate
39/12/2019

 

I think this would work if there is a way in Power BI to group the IDs and see how many swipes they had in a single day if that makes sense?

Hi @JohnW ,

 

If you want to calculate the number of customers per day, you can try this measure.

Average Swipe 1 = DISTINCTCOUNT('Table'[ID])

 

If you want to calculate the average of swipe based on customer, you can try this measure.

Average Swipe 2 = DIVIDE(SUM('Table'[Swipe Count ]) , DISTINCTCOUNT('Table'[ID]))

 

AV1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@JohnW , this seem like distinctcount

 

AverageX(Values(Table[Date]),distinctcount(Table[ID]))

Thank you @amitchandak and @v-zhenbw-msft !

 

Those functions worked.  Thank you agian for all the help!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.