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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Coffee2023
Frequent Visitor

Finding row values for last 8 days based on expression that calculates the difference in days

Hi, I need to find the pages entered Delta (new Delta Column) from the last 8 days, based on my created expression ("custom") which calculates the difference in days between my create date and today (See below screenshot column named custom). 

 

Here is my current measure and one line of data.

Delta = CALCULATE(SUMX('All Programs DE','All Programs DE'[Pages Entered], FILTER('All Programs DE', 'All Programs DE'[Custom], <8))
 

Coffee2023_1-1718743757298.png

 

Thank you in advance for your help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Coffee2023 ,

Based on my testing, please try the following methods again:

1.Create the simple tables.

vjiewumsft_0-1718766087396.png

2.Create the new custom column to calculate the difference.

Custom = 
var today_ = TODAY()
RETURN
DATEDIFF('All Programs DE'[Create Date], today_, DAY)

vjiewumsft_1-1718766100250.png

3.Create the new measure to filter the row values.

Delta = 
CALCULATE(
    SUMX(
        'All Programs DE',
        'All Programs DE'[Pages Entered]
    ),
    FILTER(
        'All Programs DE',
        'All Programs DE'[Custom] < 8
    )
)

4.The result is shown below.

vjiewumsft_2-1718766110432.png

Best Regards,

Wisdom Wu

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

1 REPLY 1
Anonymous
Not applicable

Hi @Coffee2023 ,

Based on my testing, please try the following methods again:

1.Create the simple tables.

vjiewumsft_0-1718766087396.png

2.Create the new custom column to calculate the difference.

Custom = 
var today_ = TODAY()
RETURN
DATEDIFF('All Programs DE'[Create Date], today_, DAY)

vjiewumsft_1-1718766100250.png

3.Create the new measure to filter the row values.

Delta = 
CALCULATE(
    SUMX(
        'All Programs DE',
        'All Programs DE'[Pages Entered]
    ),
    FILTER(
        'All Programs DE',
        'All Programs DE'[Custom] < 8
    )
)

4.The result is shown below.

vjiewumsft_2-1718766110432.png

Best Regards,

Wisdom Wu

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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