Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
hb0135
Helper III
Helper III

How to get the dynamically change in power bi card by current week wise.

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.

hb0135_0-1707792914167.png

BR
HB0135

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@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

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Ritaf1983
Super User
Super User

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

Ritaf1983_0-1707795679764.png

result:

Ritaf1983_1-1707795712805.png

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.

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

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

Ritaf1983_0-1707795679764.png

result:

Ritaf1983_1-1707795712805.png

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.

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hello,

Thanks for help


You're welcome 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
amitchandak
Super User
Super User

@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

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello,

Thanks for help

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.