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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Last Week Data for a Measure

Hello!

 

I am trying to display the current week's Leasing % as well as the Previous Week's in the same table.

 

I created the following measure that captures the current week's Preleasing: 

 
Calc Preleased % = CALCULATE(SUM('Property Info'[calcPreleased]),FILTER('Property Info','Property Info'[Modified]=MAX('Property Info'[Modified])))
 
However, I have had no success capturing the previous week's data. 
 
Sample data is below.
 
Thank you!
 
Property IDIdModifiedCreatedcalcOccupiedcalcPreleasedID.1
1237/8/2019 1:50:19 PM7/8/2019 1:50:19 PM99.05%100.00%58840
2247/6/2019 12:14:09 AM7/6/2019 12:14:09 AM100.00%0.00%58824
1247/3/2019 6:47:30 PM7/3/2019 6:47:30 PM98.50%99.00%58769
2247/19/2019 7:01:17 PM7/19/2019 7:01:17 PM100.00%0.00%60075
2247/19/2019 7:01:09 PM7/19/2019 7:01:09 PM100.00%0.00%60074
1237/19/2019 1:46:50 PM7/19/2019 1:46:50 PM99.05%100.00%59841
1247/19/2019 1:41:10 PM7/19/2019 1:41:10 PM97.13%99.70%59836
1237/19/2019 1:40:02 PM7/19/2019 1:40:02 PM99.05%100.00%59835
2247/12/2019 8:18:23 PM7/12/2019 8:18:23 PM100.00%0.00%59565
1247/12/2019 3:41:12 PM7/12/2019 3:41:12 PM98.50%99.00%59363
1237/12/2019 2:14:03 PM7/12/2019 2:14:03 PM99.05%100.00%59314
1237/12/2019 2:13:49 PM7/12/2019 2:13:49 PM99.05%100.00%59313
2246/8/2019 12:47:13 AM6/8/2019 12:47:13 AM100.00%0.00%56870
1246/7/2019 3:25:44 PM6/7/2019 3:25:44 PM98.50%97.30%56560
1236/7/2019 1:46:33 PM6/7/2019 1:46:33 PM99.05%100.00%56514
1236/7/2019 1:43:57 PM6/7/2019 1:43:57 PM99.05%100.00%56513
2246/28/2019 7:26:26 PM6/28/2019 7:26:26 PM100.00%0.00%58461
1246/28/2019 4:28:13 PM6/28/2019 4:28:13 PM98.50%98.50%58340
1236/28/2019 1:26:43 PM6/28/2019 1:26:43 PM99.05%100.00%58221
2246/21/2019 9:56:32 PM6/21/2019 9:56:32 PM100.00%0.00%57974
1236/21/2019 1:42:28 PM6/21/2019 1:42:28 PM99.05%100.00%57640
1246/20/2019 4:39:15 PM6/20/2019 4:39:15 PM98.50%98.50%57595
1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi bkirshenbaum,

You could use below measures to get current week and previous week’s value

previous week =
CALCULATE (
    SUM ( 'Property Info'[calcPreleased] ),
    FILTER (
        ALL ( 'Property Info' ),
        'Property Info'[Property IDId] = MIN ( 'Property Info'[Property IDId] )
            && 'Property Info'[Created]
                > TODAY () - 14
            && 'Property Info'[Created]
                <= TODAY () - 7
    )
)
this week =
CALCULATE (
    SUM ( 'Property Info'[calcPreleased] ),
    FILTER (
        ALL ( 'Property Info' ),
        'Property Info'[Property IDId] = MIN ( 'Property Info'[Property IDId] )
            && 'Property Info'[Created]
                > TODAY () - 7
            && 'Property Info'[Created] <= TODAY ()
    )
)

126.png

Best Regards,

Zoe Zhi

 

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

3 REPLIES 3
dax
Community Support
Community Support

Hi bkirshenbaum,

You could use below measures to get current week and previous week’s value

previous week =
CALCULATE (
    SUM ( 'Property Info'[calcPreleased] ),
    FILTER (
        ALL ( 'Property Info' ),
        'Property Info'[Property IDId] = MIN ( 'Property Info'[Property IDId] )
            && 'Property Info'[Created]
                > TODAY () - 14
            && 'Property Info'[Created]
                <= TODAY () - 7
    )
)
this week =
CALCULATE (
    SUM ( 'Property Info'[calcPreleased] ),
    FILTER (
        ALL ( 'Property Info' ),
        'Property Info'[Property IDId] = MIN ( 'Property Info'[Property IDId] )
            && 'Property Info'[Created]
                > TODAY () - 7
            && 'Property Info'[Created] <= TODAY ()
    )
)

126.png

Best Regards,

Zoe Zhi

 

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

Anonymous
Not applicable

@dax This works great with one exception.

 

Sometimes we have data that gets entered twice in a week to correct an error. How can I make these not aggregate the totals and instead just show the more recent of the two?

 

Thank you!

Anonymous
Not applicable

Hi @Anonymous 

Please check the following post, depends on the date table created this measure can be created in different ways.

https://community.powerbi.com/t5/Desktop/Measure-displaying-last-week-sum/td-p/495437

https://community.powerbi.com/t5/Desktop/Previous-Week-and-Previous-Month-DAX/td-p/550431

 

Thanks

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.