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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Distribute average between the duration

Hi! I have a sales with the start date, end date and duration. In order to get the sales per month, I divided the sales from the duration. Now I want to show the sales in each month instead of the start month. See below:

Gummy_0-1650364245929.png

As an example, I want to show 333.33 for 12 consecutive months

 

My original table shows as:

Gummy_0-1650364942966.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Enter Power query, copy Table to form Table2.

vyangliumsft_0-1650604721197.png

2. Click Add column – Customer column and enter the following code.

{Number.From(List.Min(#"Changed Type"[#"STARTDATE"]))..Number.From(List.Max(#"Changed Type"[#"ENDDATE"]))}

3. Click on the new row – Expand to New Rows.

vyangliumsft_1-1650604721198.png

4. Right click on [Date] - Change Type - Date/Time.

vyangliumsft_2-1650604721199.png

5. Click Add Column – Custom Column – to create two columns.

Customer.1 :

Date.Year([Date])

Customer.2:

Date.MonthName([Date])

6. Select the new two columns [Customer.1], [Customer.2] – Merge Column.

vyangliumsft_3-1650604721201.png

vyangliumsft_4-1650604721202.png

7. Select unwanted columns – Remove Columns.

vyangliumsft_5-1650604721203.png

vyangliumsft_6-1650604721203.png

8. Copy Table2 to form Table3, and select [Date] for Remove Columns.

Select Add Column – Index Column.

vyangliumsft_7-1650604721204.png

9. Create measure.

Flag =
IF(
    MAX('Table2'[Date])>=MAX('Table'[STARTDATE])&&MAX('Table2'[Date])<=MAX('Table'[ENDDATE]),MAX('Table'[HRS_PER_MONTH]),BLANK())

10. Click on Table3, select [Merged] - Column tools - Sort by column - Index.

vyangliumsft_8-1650604721205.png

11. Result:

vyangliumsft_9-1650604721207.png

 

Best Regards,

Liu Yang

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
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Enter Power query, copy Table to form Table2.

vyangliumsft_0-1650604721197.png

2. Click Add column – Customer column and enter the following code.

{Number.From(List.Min(#"Changed Type"[#"STARTDATE"]))..Number.From(List.Max(#"Changed Type"[#"ENDDATE"]))}

3. Click on the new row – Expand to New Rows.

vyangliumsft_1-1650604721198.png

4. Right click on [Date] - Change Type - Date/Time.

vyangliumsft_2-1650604721199.png

5. Click Add Column – Custom Column – to create two columns.

Customer.1 :

Date.Year([Date])

Customer.2:

Date.MonthName([Date])

6. Select the new two columns [Customer.1], [Customer.2] – Merge Column.

vyangliumsft_3-1650604721201.png

vyangliumsft_4-1650604721202.png

7. Select unwanted columns – Remove Columns.

vyangliumsft_5-1650604721203.png

vyangliumsft_6-1650604721203.png

8. Copy Table2 to form Table3, and select [Date] for Remove Columns.

Select Add Column – Index Column.

vyangliumsft_7-1650604721204.png

9. Create measure.

Flag =
IF(
    MAX('Table2'[Date])>=MAX('Table'[STARTDATE])&&MAX('Table2'[Date])<=MAX('Table'[ENDDATE]),MAX('Table'[HRS_PER_MONTH]),BLANK())

10. Click on Table3, select [Merged] - Column tools - Sort by column - Index.

vyangliumsft_8-1650604721205.png

11. Result:

vyangliumsft_9-1650604721207.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Can I please know the data model (joins) of this solution? 

Anonymous
Not applicable

@Anonymous any luck on the model please. I do not get the required result

amitchandak
Super User
Super User

@Anonymous , refer if the attached file can help

 

 

or the blog

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-or-end-date/ba-p/1503785

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors