cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ado2
Frequent Visitor

Calculate Average based on time filter selected

Hi
I have 6 months' worth of data ranging from Jan to Jun 2019 (below is a sample of the dataset). I am trying to create average measure (daily/weekly/monthly excluding weekends) for the count of IDs. Ideally these averages should change if I select different time periods. But my average measures don't seem to work well. As I select a different time, say Jan and Feb, the daily average I got is not exactly daily average between Jan and Feb. What I got is the total daily averages of Jan and Feb


Eg: Daily average of IDs count 
Jan 1000
Feb 2000 
--> daily average I want should be (1000+2000)/2 = 1500. But what I got is 3000


Capture.PNG

 

Any guidance would be appreciated!

 

Thanks

3 REPLIES 3
Community Support
Community Support

Re: Calculate Average based on time filter selected

@ado2 ,

 

You can create a measure using dax below:

Avg = CALCULATE(AVERAGE('Table'[IDs]), ALLSELECTED('Table'[Date]))

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

Highlighted
ado2
Frequent Visitor

Re: Calculate Average based on time filter selected

Thanks for getting back @v-yuta-msft !

I want to exclude weekends from my average calculation. Will that function work in that case ? 

ado2
Frequent Visitor

Re: Calculate Average based on time filter selected

I should probably rephrase my problem to make it clearer @v-yuta-msft 

My original dataset includes transactions settled during business days only (we call it settle dates)

Following instructions from other post, I create a calendar table and build daily/weekly/monthly average measures based on the count of work days in that calendar. These measure work well if they stand alone but will break if I put in a time slicer. Will very much appreciate any help

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors