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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Meerakhanna
Helper I
Helper I

Dynamic Past 5 weeks

Hi!

Is there a way to have dynamically have only 5 weeks in a separate calculated table? 

I have one fact table, one Date Dim. I am trying to create a calculated table which will have values  of only 5 week dates as per the selection made in Date Dim. If I click one date value in the Date Dim, this calculated table should bring values of 5 week dates past to that selected dates.

 

Main need is, We are trying to see Top 5 products with past 5 week's status of the same product. User will select the week as parameter, the result should display the status of the products for past 5 weeks  from the selected week.

 

Any idea please help! - Thank you!

2 REPLIES 2
Greg_Deckler
Super User
Super User

Sample data would help tremendously:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Need: How to make the Year and Week selection dynamic. As of now the 35th Week is hard coded to select past 5 week's data from that week. - Please help! - Thank you!

 

Please find the below as Data set

YearWeek dayWeekPrdSoldWeekNameSORT_ORDR
20178/28/201735Prd 524Week 34 Position6
20178/28/201735Prd 36Week 34 Position6
20178/28/201735Prd 43Week 34 Position6
20178/28/201735Prd 12Week 34 Position6
20178/28/201735Prd 21Week 34 Position6
20178/28/201735Prd 117Week 351
20178/28/201735Prd 215Week 351
20178/28/201735Prd 314Week 351
20178/28/201735Prd 410Week 351
20178/28/201735Prd 55Week 351
20178/21/201734Prd 231Week 342
20178/21/201734Prd 430Week 342
20178/21/201734Prd 130Week 342
20178/21/201734Prd 38Week 342
20178/21/201734Prd 51Week 342
20178/14/201733Prd 438Week 333
20178/14/201733Prd 132Week 333
20178/14/201733Prd 221Week 333
20178/14/201733Prd 315Week 333
20178/14/201733Prd 55Week 333
20178/7/201732Prd 133Week 324
20178/7/201732Prd 426Week 324
20178/7/201732Prd 225Week 324
20178/7/201732Prd 36Week 324
20178/7/201732Prd 52Week 324
20177/31/201731Prd 239Week 315
20177/31/201731Prd 133Week 315
20177/31/201731Prd 428Week 315
20177/31/201731Prd 311Week 315
20177/31/201731Prd 55Week 315

Expected soln as below Pivot,

Sum of SoldColumn Labels      
Row LabelsWeek 34 PositionWeek 31Week 32Week 33Week 34Week 35Grand Total
Prd 123333323017147
Prd 213925213115132
Prd 361161581460
Prd 432826383010135
Prd 5245251542
Grand Total361169211110061516

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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