Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hello ,
I have the following table in Power Bi :
| Movement type | Calendar week | Actual | PreviousWeek |
| Net Growth | 202452 | 50 | |
| Net Disconnections | 202452 | 750 | |
| Net Connections | 202452 | 800 | |
| Net Growth | 202501 | 300 | 50 |
| Net Disconnections | 202501 | 200 | 750 |
| Net Connections | 202501 | 500 | 800 |
| Net Growth | 202502 | 100 | 300 |
| Net Disconnections | 202502 | 900 | 200 |
| Net Connections | 202502 | 1000 | 500 |
I need to find the correct formula to get the last column 'Previous Week' that is the actual value of each single movement type related to the previous week.
Thanks for the help,
Romina
Solved! Go to Solution.
Hi @romina80,
You can use below DAX logic to create new Calculated column
PreviousWeek =
VAR CurrentMovement = 'Movements'[Movement type]
VAR CurrentWeek = 'Movements'[Calendar week]
VAR PreviousWeekNumber =
CALCULATE(MAX('Movements'[Calendar week]),
FILTER('Movements', 'Movements'[Calendar week] < CurrentWeek))
RETURN
CALCULATE(MAX('Movements'[Actual]),
FILTER('Movements',
'Movements'[Movement type] = CurrentMovement &&
'Movements'[Calendar week] = PreviousWeekNumber
))
Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.
Hi @romina80
Try using filtered TopN:
Prev Week =
VAR _type = 'Table'[Movement type]
VAR _week = 'Table'[Calendar week]
VAR _prevWeekRow =
TOPN (
1,
FILTER (
'Table',
'Table'[Calendar week] < _week && 'Table'[Movement type] = _type
),
[Calendar week], DESC
)
RETURN
MAXX ( _prevWeekRow, [Actual] )
Hi,
This calculated column formula works
=LOOKUPVALUE(Data[Actual],[Calendar week],CALCULATE(MAX(Data[Calendar week]),FILTER(Data,Data[Movement type]=EARLIER(Data[Movement type])&&Data[Calendar week]<EARLIER(Data[Calendar week]))),Data[Movement type],Data[Movement type])
Hope this helps.
Hi @romina80,
You can use below DAX logic to create new Calculated column
PreviousWeek =
VAR CurrentMovement = 'Movements'[Movement type]
VAR CurrentWeek = 'Movements'[Calendar week]
VAR PreviousWeekNumber =
CALCULATE(MAX('Movements'[Calendar week]),
FILTER('Movements', 'Movements'[Calendar week] < CurrentWeek))
RETURN
CALCULATE(MAX('Movements'[Actual]),
FILTER('Movements',
'Movements'[Movement type] = CurrentMovement &&
'Movements'[Calendar week] = PreviousWeekNumber
))
Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.
have you got a date tabel ?
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!