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
Anonymous
Not applicable

Best approach to calculate averages over time

Hello,

 

I am very new to PBI (only been using it for a week) and I am stumped on how to approach a problem.  It would seem that this would be easy.

 

I have a table with several columns, but need to pull out data from these three.  I have to pull the average number of users for each system by each of the dates.  What would be the best approach to take to do this?  Should I set up a dynamic table or use a Let function or perhaps you have a better approach. What function or combination of functions should I use to total up all of the user andcreate an average per system on each of the dates. 

 

Dateuser IDsystem
1/3/2018113123
1/3/2018147246
1/3/2018184434
1/3/2018754123
1/3/2018865467
1/3/2018976434
1/9/2018111246
1/9/2018357434
1/9/2018457246
1/9/2018738246
1/9/2018864123
2/15/2018111246
2/15/2018113467
2/15/2018135434
2/15/2018357246
2/15/2018357434
2/15/2018526434
2/15/2018526434
3/1/2018111123
3/1/2018111246
3/1/2018113467
3/1/2018114246
3/1/2018114467
3/1/2018147434
3/1/2018184246
3/1/2018976434
1 ACCEPTED SOLUTION

Hi,

 

I believe this is your expected result.  Download the PBI file from here.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
Greg_Deckler
Super User
Super User

Just so I am clear, with that given set of data, what are your expected results?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

For each of the dates (of where there are 6 in my table) I would get and average number of users per system.  So for example:

 

on 2/9  if there were 3 users for system 1, 8 users for system 2, 12 users for system 3, the average number of users would be =

 

3+8+12 = 23 divided by 3 = 7.67 on 2/9

 

I would need to do this for each of the 6 dates.

Anonymous
Not applicable

And by the way, my table has over a million records.

 

Hi,

 

I believe this is your expected result.  Download the PBI file from here.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Ashish - QQ is Average number of users a measure, column or a new table?

 

I am sorry for all of the questions, but I am just so new at this.

Hi,

 

All i did was to create a Calendar Table by going to Modelling > New Table.  I then created a relatiosnship between the Date column Data Table to the Date column of the Calendar Table.  Thereafter, i wrote the measure named Average number of users.

 

If my offered solution does not meet your exact requirement, then please tell me the exact result you are expecting.  Show a picture of the result you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thank you so much Ashish!!  It appears to be working on the 1M records.  Now I will attempt to run it against the full set of data.  I really appreaciate it.

You are welcome


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Ashish,

 

Is there any way to step through each of the processes to see what data is coming out?  In other words, how can I validate my data to ensure that what I want as the end result is what I am actually getting?  "Trust by verify" my results.

Anonymous
Not applicable

Ashish,

 

Thank you so much for taking the time to help me out on this.  Seeing the calculation that you created, I am not sure that I would have gotten this far.  I think you are close.  I am actually trying

to calculate the average number of user by system for each date.  I think this just give me the average number of users for all systems per date.

 

The data that I provided was a very sample set of data made up to illustrate my question. My file is very large. So I actually need to know how to duplicate your steps.  I was able to follow some of what you did, but not all.  I am coming to realize that PBI is a humbling tool.

 

I can't tell you how much I appreciate you getting me this far.  I am going to try to play with the sample

set to see if I can figure it out from here.

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.