cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Meerakhanna Regular Visitor
Regular Visitor

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
Super User
Super User

Re: Dynamic Past 5 weeks

Sample data would help tremendously:

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

 


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!


Meerakhanna Regular Visitor
Regular Visitor

Re: Dynamic Past 5 weeks

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
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 227 members 3,055 guests
Please welcome our newest community members: