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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sunila
Helper I
Helper I

Amount breakdown in 13 week bucket

Hi, 

 

I've encountered a challenge while working on weekly bucket. I intend to display a distribution of weekly amounts for the upcoming 13 weeks. I attempted to link Table A's "WeekStartDate" with Table B's "date" column to retrieve the amount. However, this join appears to be ineffective, as amounts aren't appearing for all weeks as expected.

In an effort to address this, I tried merging the two tables using Power Query. Unfortunately, using a Left join did not yield any matching records due to the weekly date folding. My objective is to ensure that all dates are displayed in correspondence with the respective weeks, where the WeekEndDate signifies the week's conclusion.

Could anyone offer any guidance or suggestions ?

 

Sunila_0-1691144053585.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Xinru Zhu 

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

4 REPLIES 4
Sunila
Helper I
Helper I

Hi, @Anonymous 

Unfortunately, I dont have the appropriate role to attach the pbi.

Here is screen shot of Table A and advance editor code

let
Source = {Int32.From(DateTime.LocalNow())-1..Int32.From(DateTime.LocalNow())+6*14+1},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Date.AddDays([Column1],6)),
#"Filtered Rows" = Table.SelectRows(#"Added Custom", each Date.DayOfWeek([Column1])=Date.DayOfWeek(DateTime.LocalNow())),
#"Added Custom1" = Table.AddColumn(#"Filtered Rows", "Custom.1", each Date.ToText([Column1],[Format="dd/M"]) & "-" & Date.ToText([Custom],[Format="dd/M"])),
#"Renamed Columns" = Table.RenameColumns(#"Added Custom1",{{"Column1", "WeekStartDate"}, {"Custom", "WeekEndDate"}, {"Custom.1", "Week"}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns",{{"WeekStartDate", type date}, {"WeekEndDate", type date}})
in
#"Changed Type1"

Sunila_0-1691430973864.png

Table B

Sunila_1-1691431017402.png

Table A.WeekStartDate join Table B.Date (One to many)

Report View : Amount distribution is not appearing for some week buckets, Amount in 13 weeks bucket must add up to Totals in Right. 

Sunila_2-1691431062112.png

Please note, report is designed to dynamically start from the current date. So, each week will kick off with today's date. Should have any questions please let me know. 

 

 

Anonymous
Not applicable

Xinru Zhu 

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.

 

Thank you so much, your proposed solution did work.

Anonymous
Not applicable

Hi @Sunila 

Can you provide some more sample data or pbix file, I cannot get the information based on the picture you have provided.

 

Best Regards!

Yolo Zhu

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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