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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
009co
Helper IV
Helper IV

How to get sum of values for most recent week that has values (might be in past eg not last week's)

How to get sum of values and the week value for most recent week that has values (might be in past eg not last week's).

 

I have a date table which has:

* week of year eg 44

* week of year + year eg 44-2022

* start of week/end of week eg as dates

 

I want to:

* put the sum of values and the week value on cards.

* calculate most recent week vs most recent week previous week change in percent

 

I have got most recent date and most recent date's sum of values as:

 

most recent date = CALCULATE(
    MAX(mytable[date]),
    LASTDATE('mytable'[date])
)
 
recent date's sum of values = CALCULATE(
    SUM(mytable[value]),
    LASTDATE('mytable'[date])
)

 

How to translate these into getting most recent week instead of most recent date?

1 REPLY 1
lbendlin
Super User
Super User

Add one more step.

 

- get max date

- get the week of the max date

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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