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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
619SK
Helper II
Helper II

Week on Week in Column

I want to calculate WoW% in column field  and not as measure which post in values.

So ideally i am doing wow%  by adding column

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @619SK 

You can put the following code to advanced editor in power query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCihKLcvMLy1WCE9NzVaK1SFXxLm0qCg1r2TABXwSi4nhxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Week = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Week", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Week"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"Data", each _,type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "WoW% ", each (List.Min(Table.SelectRows(#"Grouped Rows",(x)=>x[Week]="Current Week")[Count])-List.Min(Table.SelectRows(#"Grouped Rows",(x)=>x[Week]="Last Week")[Count]))/List.Min(Table.SelectRows(#"Grouped Rows",(x)=>x[Week]="Last Week")[Count])),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Week"}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Removed Columns", "Data", {"Week"}, {"Week"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Expanded Data",{"Week", "Count", "WoW% "})
in
    #"Reordered Columns"

Output

vxinruzhumsft_0-1701238334307.png

Best Regards!

Yolo Zhu

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

5 REPLIES 5
Anonymous
Not applicable

Hi @619SK 

You can put the following code to advanced editor in power query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCihKLcvMLy1WCE9NzVaK1SFXxLm0qCg1r2TABXwSi4nhxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Week = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Week", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Week"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"Data", each _,type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "WoW% ", each (List.Min(Table.SelectRows(#"Grouped Rows",(x)=>x[Week]="Current Week")[Count])-List.Min(Table.SelectRows(#"Grouped Rows",(x)=>x[Week]="Last Week")[Count]))/List.Min(Table.SelectRows(#"Grouped Rows",(x)=>x[Week]="Last Week")[Count])),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Week"}),
    #"Expanded Data" = Table.ExpandTableColumn(#"Removed Columns", "Data", {"Week"}, {"Week"}),
    #"Reordered Columns" = Table.ReorderColumns(#"Expanded Data",{"Week", "Count", "WoW% "})
in
    #"Reordered Columns"

Output

vxinruzhumsft_0-1701238334307.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

619SK
Helper II
Helper II

619SK_0-1701184459529.png

 

619SK
Helper II
Helper II

619SK_0-1701184340516.png

 

PijushRoy
Community Champion
Community Champion

Hi @619SK 

Can you please try below measure, please replace the column name in DAX 

Previous Week = Calculate(Count(table_name),Column_Name="Previous Week"))
Current Week = Calculate(Count(table_name),Column_Name="Current Week"))
Last Week = Calculate(Count(table_name),Column_Name="Last Week"))

Last Result = Divide((Current week - last week),Last Week)



Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





PijushRoy
Community Champion
Community Champion

Hi @619SK 

Please share sample data, expected result.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.