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
netanel
Post Prodigy
Post Prodigy

Daily AVG

Hi All!

 

I have this maesure:

Net USD AVG =
CALCULATE(
DIVIDE( SUM( 'DB 2022'[Net USD] ), COUNTROWS( 'Date' ) ),
keepfilters( 'Date'[Date] < TODAY())
)

It works great
It divides the Data on the current day of the month for example the 16th of January so it will only divide by 16 days
My problem starts that sometimes the Data is only up to 12 or less and then the Divide is incorrect

How do I change the formula so that it only divides the number of days in the existing Data?

 

Thanks 








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
2 ACCEPTED SOLUTIONS
littlemojopuppy
Community Champion
Community Champion

Hi @netanel.  This should calculate a daily average for all dates in the filter context

Daily Average =
AVERAGEX(
	VALUES([Your date field]),
	SUM('DB 2022'[Net USD])
)

 

Hope this helps!

View solution in original post

Hi @littlemojopuppy  thanks for the response!

 

Problem number 1:

pro 1.JPG

 

 

 

 

 

 

 

 

Problem number 2:

I can not share my data but
Problem number 2 is simple and I overcame it in my formula above
The problem is that if every day I get 5000
So when I go up to the monthly level instead of getting an average of 5000 for January I get 31 times 5000 that it comes out to 155,000
And if I go up to the quarter level then I get 155K double 3








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

View solution in original post

8 REPLIES 8
littlemojopuppy
Community Champion
Community Champion

@netanel awesome!  I'm glad that what I suggested you try ended up being the solution!  😊

@littlemojopuppy 

Who defined this as a solution?
Nothing was resolved
And I did not define it as a solution ...








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

@netanel you said that you overcame your issue with the solution in the pic you supplied, which was exactly what I suggested.  The other issue you mentioned is from information not included in the initial request...

@littlemojopuppy 

Maybe I accidentally clicked on Get a solution and iam sorry for that.


But in the picture you can see that I get the 31st per month even though I am only on the 18th of the month
Or my data is only up to the 16th of the month
This is one problem

Problem number two
When rising to a monthly or quarterly level there is no calculation of average at all








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
littlemojopuppy
Community Champion
Community Champion

Hi @netanel.  This should calculate a daily average for all dates in the filter context

Daily Average =
AVERAGEX(
	VALUES([Your date field]),
	SUM('DB 2022'[Net USD])
)

 

Hope this helps!

@littlemojopuppy 

Hi thanks for the response,


There are two problems
1. He also brings data from the 31st day of the month even though I am on the 17th of the month

2. As soon as I go up in a hierarchy to the level of a month it is summed up all the days of the month and then
If I earned 5000 a day then the average monthly level becomes 30 times 5000
And the average should remain 5000
That is, when I go up to the monthly and quarterly level he sums up all the amounts

 

thanks








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

@netanel I don't understand how that figures into the problem.  Can you provide additional info?

Hi @littlemojopuppy  thanks for the response!

 

Problem number 1:

pro 1.JPG

 

 

 

 

 

 

 

 

Problem number 2:

I can not share my data but
Problem number 2 is simple and I overcame it in my formula above
The problem is that if every day I get 5000
So when I go up to the monthly level instead of getting an average of 5000 for January I get 31 times 5000 that it comes out to 155,000
And if I go up to the quarter level then I get 155K double 3








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

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.