Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have create a card for plan and actual delivery in power bi but for current week i need to select in filters in each week for that i need dynamic card for currrent week for below data i.e in excel till week 52.
BR
HB0135
Solved! Go to Solution.
@hb0135 , You can have date table with week rank, based on the selection
Have these new columns in the Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Or based on today you can have
This Week Today =
var _min = today() -WEEKDAY(today() ,2) +1 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Last Week Today =
var _min = today() -WEEKDAY(today() ,2) -6 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
In case you have active inactive join you can first create a measure with userelationship
calculate( SUM('Table'[Amount]),USERELATIONSHIP ('Table'[Actual Delivery Date], 'Date'[Date]))
And then use week code
Hi @hb0135
If you don't have a date table in your model you can use a dynamic filter - top n to take the last week
+ Filter out zeros
result:
pbix is attached
Note that this is not the best practice .
My recommend is to learn about the data table and use it in the model.
For more information please refer :
https://www.youtube.com/watch?v=LfKm3ATibpE
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi @hb0135
If you don't have a date table in your model you can use a dynamic filter - top n to take the last week
+ Filter out zeros
result:
pbix is attached
Note that this is not the best practice .
My recommend is to learn about the data table and use it in the model.
For more information please refer :
https://www.youtube.com/watch?v=LfKm3ATibpE
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hello,
Thanks for help
You're welcome 🙂
@hb0135 , You can have date table with week rank, based on the selection
Have these new columns in the Date Table, Week Rank is Important in Date/Week Table
Week Rank = RANKX('Date','Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX('Date','Date'[Year Week],,ASC,Dense) //YYYYWW format
These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Or based on today you can have
This Week Today =
var _min = today() -WEEKDAY(today() ,2) +1 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Last Week Today =
var _min = today() -WEEKDAY(today() ,2) -6 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
In case you have active inactive join you can first create a measure with userelationship
calculate( SUM('Table'[Amount]),USERELATIONSHIP ('Table'[Actual Delivery Date], 'Date'[Date]))
And then use week code
Hello,
Thanks for help
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
72 | |
38 | |
31 | |
26 |