Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
87 | |
65 | |
50 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |