Forum Discussion

netanel's avatar
netanel
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

Bring data only to the present day

Hi All!

I have a Divide DAX that divides the money by date
And so I get an excellent daily average.


I connect  Keepfilters to it of a date
To bring me only up to the date of the present day

 

Now I'm in trouble
My data does not always reach the present day
Sometimes the current day is the 18th of the month and the data is only updated until the 12th of the month.


What happens is that the formula divides the money by 18 instead of 12 and that's how I get a wrong average
I try to solve this with Values but always in the current month I have minus money on the 31st of the month

 

The right thing to do is:
To bring data by the day they arrive at DB
how do I do it?

Please save me
I've tried everything already

This is the formula that works for me right now:

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

 

  • Hi, netanel ;

    First, it's not very clear about your table structure, if you want the divisor of January to be 31? February is 28...and so on. if so ,you could try 

    COUNTX ( FILTER ( 'Date', MONTH ( [Date] ) = MONTH ( TODAY () ) ), [Date] )
    

    If not, Can you provide a simple file and screenshot of the result you want to output? It makes it easier to give you a solution.

    Looking forward to your reply!

     

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 Replies

  • netanel , Try a measure like

     


    Net USD AVG =

    AverageX(Values( 'Date'[Date] ), CALCULATE( SUM( 'DB 2022'[Net USD] ),
    keepfilters('Date'[Date] < TODAY())) )

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, netanel ;

    First, it's not very clear about your table structure, if you want the divisor of January to be 31? February is 28...and so on. if so ,you could try 

    COUNTX ( FILTER ( 'Date', MONTH ( [Date] ) = MONTH ( TODAY () ) ), [Date] )
    

    If not, Can you provide a simple file and screenshot of the result you want to output? It makes it easier to give you a solution.

    Looking forward to your reply!

     

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.