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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Augmenting data by week

Hi all,

 

I have a table like that


PERIOD         PLANT          TYPE

201801             A                 X
201801             B                 Y


Actually the table and values not important. I want to make some change on my table.  I need to augment the data like that.

PERIOD         PLANT          TYPE

20180101         A                 X
20180102         A                 X
20180103         A                 X
20180104         A                 X
20180101         B                 Y
20180102         B                 Y
20180103         B                 Y
20180104         B                 Y


I don't have to access to actual data (source is access) because of that i have to make that on power bi.  Is it possible ? If is it possible how can i do that ? 

Thanks.

A.

         

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

if you just need 52 weeks for each entry then it's simple:

1) in the query editor add a new column (name it WeekNr) with this syntax:

{1..52}

2) expand the values to rows

3) create a new column which is 

[Period]*100+[WeekNr]

4) remove unnecessary columns

 
EDIT what I don't get is that you say that you want it as in real calendar - if that's the  case why do you need week 51 for 201201 which to me seems to be January 2012? it only had 5 weeks at most. Or is it not related to month?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

3 REPLIES 3
Stachu
Community Champion
Community Champion

you can do it in the query editor - do you always assume 4 weeks in a month or does it have to be related to the real calendar weeks? How do you want to show split weeks i.e. weeks that fall into 2 months?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

This table doesn't display the requested data. I create it for just show. It's demo.

I have a period column which start 201201 to today (201811 -always last month ) and i want to augment it for 52 weeks. In summary i want to multiply each row data with 52 weeks.  I want it like real calendar
For example 
Period : 201201

20120101
20120102
.
.
.
20120151
20120152


Actually i don't know how to do in query editor

Stachu
Community Champion
Community Champion

if you just need 52 weeks for each entry then it's simple:

1) in the query editor add a new column (name it WeekNr) with this syntax:

{1..52}

2) expand the values to rows

3) create a new column which is 

[Period]*100+[WeekNr]

4) remove unnecessary columns

 
EDIT what I don't get is that you say that you want it as in real calendar - if that's the  case why do you need week 51 for 201201 which to me seems to be January 2012? it only had 5 weeks at most. Or is it not related to month?



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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