Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi Experts
Need a calculated column Flag to show 1 - where the date is in the previous 5 Weeks based on todays date and week no. The following is a image of my Table where is need to add the Previous 5 Weeks flag
Solved! Go to Solution.
@Anonymous , In case nothing is selected
This Week Today =
var _min1 = today() -WEEKDAY(today() ,2) +1 //Monday week start
var _min = _min1 - 28
var _max = _min1 +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
if you need based on selection
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max1 = maxx(allselected(Date1),Date1[Date])
var _min1 = _max1 -WEEKDAY(_max1 ,2) +1 //Monday week start
var _min = _min1 - 28
var _max = _min1 +6
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
Need of an Independent/disconnected Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
@Anonymous , In case nothing is selected
This Week Today =
var _min1 = today() -WEEKDAY(today() ,2) +1 //Monday week start
var _min = _min1 - 28
var _max = _min1 +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
if you need based on selection
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max1 = maxx(allselected(Date1),Date1[Date])
var _min1 = _max1 -WEEKDAY(_max1 ,2) +1 //Monday week start
var _min = _min1 - 28
var _max = _min1 +6
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
Need of an Independent/disconnected Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Hi Amit
Are the above measures calculated columns measures and what does not refer too in the first measure
Check out the March 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
93 | |
64 | |
56 | |
46 | |
45 |