Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
79 | |
65 | |
52 | |
30 |
User | Count |
---|---|
115 | |
114 | |
71 | |
66 | |
39 |