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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
netanel
Post Prodigy
Post Prodigy

Daily AVG

Hi All!

 

I have this maesure:

Net USD AVG =
CALCULATE(
DIVIDESUM'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 18th of January so it will only divide by 18 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
1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @netanel ,

 

This filtered context used by this measure is not the same as you want.

Try to remove some filters which has effected this measure's context. I mean replace the keepfilters() by allexcpet() or allselected() .

 

Try some code like the following:

Net USD AVG =
CALCULATE(
    DIVIDE( SUM( 'DB 2022'[Net USD] ), COUNTROWS( 'Date' ) ),
    ALLEXCEPT( 'Date', 'Date'[month] ),
    // OR filter(all('Date'),month([Date]) = month(today()) ),
    'Date'[date] <= TODAY()
)

 

Best Regards

Community Support Team _ chenwu zhu

 

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

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @netanel ,

 

This filtered context used by this measure is not the same as you want.

Try to remove some filters which has effected this measure's context. I mean replace the keepfilters() by allexcpet() or allselected() .

 

Try some code like the following:

Net USD AVG =
CALCULATE(
    DIVIDE( SUM( 'DB 2022'[Net USD] ), COUNTROWS( 'Date' ) ),
    ALLEXCEPT( 'Date', 'Date'[month] ),
    // OR filter(all('Date'),month([Date]) = month(today()) ),
    'Date'[date] <= TODAY()
)

 

Best Regards

Community Support Team _ chenwu zhu

 

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

Whitewater100
Solution Sage
Solution Sage

Hello:

Can you try:

AVERAGEX(VALUES('Date'[Date]), 
[Net USD])

 

You can add conditional statements before it like:

 

IF( [Net USD] > 0, 
AVERAGEX(VALUES('Date'[Date]), 
[Net USD])

)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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