cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yashdsin Frequent Visitor
Frequent Visitor

Handling week on week change

Sample data file

Hi,

I have a sample data(attached) and i want to show the visualization for this data in Power Bi which has a new data added every week. Is there and solution to this?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Handling week on week change

Hi @yashdsin ,

 

Please connect the sample worksheet, and then use the below Mcode in query editor:

let
    Source = Excel.Workbook(File.Contents("C:\Users\dinaye\Desktop\Sample (1).xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Changed Type" = Table.TransformColumnTypes(Sheet1_Sheet,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type any}, {"Column5", type any}, {"Column6", type any}, {"Column7", type any}, {"Column8", type any}, {"Column9", type any}, {"Column10", type any}, {"Column11", type any}, {"Column12", type any}}),
    #"Filled Down" = Table.FillDown(#"Changed Type",{"Column1", "Column2"}),
    #"Transposed Table" = Table.Transpose(#"Filled Down"),
    #"Replaced Value" = Table.ReplaceValue(#"Transposed Table",null,0,Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","Same",null,Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
    #"Filled Down1" = Table.FillDown(#"Replaced Value1",{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
    #"Replaced Value2" = Table.ReplaceValue(#"Filled Down1",0,null,Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
    #"Transposed Table1" = Table.Transpose(#"Replaced Value2"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Months", type text}, {"Commodity", type text}, {"Specification", type text}, {"6/10/2019", Int64.Type}, {"6/17/2019", Int64.Type}, {"6/24/2019", Int64.Type}, {"7/2/2019", Int64.Type}, {"7/8/2019", Int64.Type}, {"7/15/2019", Int64.Type}, {"7/22/2019", Int64.Type}, {"7/29/2019", Int64.Type}, {"7/29/2019_1", type any}})
in
    #"Changed Type1"

Then apply the change, and build the visual:

006.PNG

You can use the drilldown to gind next hierachy. 

pbix attached: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EdeqcDMD2LNOrKpkoWPmrF...

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

7 REPLIES 7
Community Support Team
Community Support Team

Re: Handling week on week change

Hi @yashdsin ,

 

I can't access your data with your link, it seems the accessbility is limited. would you mind sharing on Onedrive using "Anyone with the link can edit"? or using dropbox? Make sure the confidential info has been removed before.

 

Best regards,

Dina Ye

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
yashdsin Frequent Visitor
Frequent Visitor

Re: Handling week on week change

Highlighted
yashdsin Frequent Visitor
Frequent Visitor

Re: Handling week on week change

Community Support Team
Community Support Team

Re: Handling week on week change

Hi @yashdsin ,

 

Successfully got your data, thanks!  how do you want to show the visual? 

And am coufused about what does the "same" represent? same as the left one? Or the down-next one?

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
yashdsin Frequent Visitor
Frequent Visitor

Re: Handling week on week change

I update this table every week and i am trying to get a meaniningfull visualization for this so that whenever i update a new column with a new date it reflects in visualization rather then sending this data table. Your inputs will be great. Data will go down next one for the upcoming month of Aug.

Community Support Team
Community Support Team

Re: Handling week on week change

Hi @yashdsin ,

 

Please connect the sample worksheet, and then use the below Mcode in query editor:

let
    Source = Excel.Workbook(File.Contents("C:\Users\dinaye\Desktop\Sample (1).xlsx"), null, true),
    Sheet1_Sheet = Source{[Item="Sheet1",Kind="Sheet"]}[Data],
    #"Changed Type" = Table.TransformColumnTypes(Sheet1_Sheet,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type any}, {"Column5", type any}, {"Column6", type any}, {"Column7", type any}, {"Column8", type any}, {"Column9", type any}, {"Column10", type any}, {"Column11", type any}, {"Column12", type any}}),
    #"Filled Down" = Table.FillDown(#"Changed Type",{"Column1", "Column2"}),
    #"Transposed Table" = Table.Transpose(#"Filled Down"),
    #"Replaced Value" = Table.ReplaceValue(#"Transposed Table",null,0,Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","Same",null,Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
    #"Filled Down1" = Table.FillDown(#"Replaced Value1",{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
    #"Replaced Value2" = Table.ReplaceValue(#"Filled Down1",0,null,Replacer.ReplaceValue,{"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12"}),
    #"Transposed Table1" = Table.Transpose(#"Replaced Value2"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Months", type text}, {"Commodity", type text}, {"Specification", type text}, {"6/10/2019", Int64.Type}, {"6/17/2019", Int64.Type}, {"6/24/2019", Int64.Type}, {"7/2/2019", Int64.Type}, {"7/8/2019", Int64.Type}, {"7/15/2019", Int64.Type}, {"7/22/2019", Int64.Type}, {"7/29/2019", Int64.Type}, {"7/29/2019_1", type any}})
in
    #"Changed Type1"

Then apply the change, and build the visual:

006.PNG

You can use the drilldown to gind next hierachy. 

pbix attached: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EdeqcDMD2LNOrKpkoWPmrF...

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

Community Support Team
Community Support Team

Re: Handling week on week change

Hi @yashdsin ,

 

If my above post helps, could you please consider Accept it as the solution to help the other members find it more quickly. thanks!

Best regards,
Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)