Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi guys, please help me figure this problem out
I want to show previous data like this
Solved! Go to Solution.
Hi @carade97 ,
Here are the steps you can follow:
1. Create measure.
Flag =
var _selectyear=SELECTEDVALUE('Date'[Year])
var _selectmonth=SELECTEDVALUE('Date'[Month])
var _selectweek=SELECTEDVALUE('Date'[Week])
var _date1=
MINX(
FILTER(ALL('Date'),
'Date'[Year]=_selectyear&&'Date'[Month]=_selectmonth&&'Date'[Week]=_selectweek),[Date])
var _date2=
MAXX(
FILTER(ALL('Date'),
'Date'[Year]=_selectyear&&'Date'[Month]=_selectmonth&&'Date'[Week]=_selectweek),[Date])
return
IF(
MAX('Table'[Date]) >=_date1-7&&MAX('Table'[Date])<=_date2-7,1,0)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @carade97 ,
Here are the steps you can follow:
1. Create measure.
Flag =
var _selectyear=SELECTEDVALUE('Date'[Year])
var _selectmonth=SELECTEDVALUE('Date'[Month])
var _selectweek=SELECTEDVALUE('Date'[Week])
var _date1=
MINX(
FILTER(ALL('Date'),
'Date'[Year]=_selectyear&&'Date'[Month]=_selectmonth&&'Date'[Week]=_selectweek),[Date])
var _date2=
MAXX(
FILTER(ALL('Date'),
'Date'[Year]=_selectyear&&'Date'[Month]=_selectmonth&&'Date'[Week]=_selectweek),[Date])
return
IF(
MAX('Table'[Date]) >=_date1-7&&MAX('Table'[Date])<=_date2-7,1,0)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Measure week -1 =
VAR MaxWeek = CALCULATE(LASTNONBLANK('Date table'[Index],1),ALLSELECTED('Date table'))
Return
CALCULATE([Your Measure],ALL('Date table'),'Date table'[Index]+1=MaxWeek)
Depending how the table is sorted when adding the index you might need to replace the +1 with a -1 in the return part.
Let me know if you need any more help implementing this 🙂
Jasper
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!