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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Expand a table using start and end dates

Hi there

 

I have a dataset that has a start and end date with 3 sets of numbers that I need to work out the monthly amount for and then put that amount in the correct month for each of the three amounts.

 

For example, row 1 starts on 1 Sep 20 and ends 31 Aug 21. The premium and comm are the upfront annual amounts so I need to populate a Premium Monthly field for Sep 2020 with 4,173.42, same for Oct, Nov etc to Aug 21. Then repeat that for Comm1 Monthly and Comm2 Monthly and then repeat that down the list to the bottom.

 

The end result would then allow me to run a pivot or cube in say Jul 21 that will return the total Premium, Comm1 and Comm2 that applies to that month. Can M or DAX do this and if so, please let me know how?

 

PeriodStartPeriodEndPremium Comm1 Comm2 MonthsPremium Monthly Comm1 Monthly Comm2 Monthly 
01/09/202031/08/202150,081.06-  10,016.21  12.004,173.42-  834.68
01/05/202130/04/2022165,021.5323,103.0133,004.31  12.0013,751.791,925.252,750.36
01/07/202130/06/202255,680.916,960.1111,136.18  12.004,640.08580.01928.02
01/07/202130/06/202212,373.19556.792,474.64  12.001,031.1046.40206.22
01/07/202130/06/2022171,295.917,708.3234,259.18  12.0014,274.66642.362,854.93
01/07/202130/06/2022161,189.687,253.5432,237.94  12.0013,432.47604.462,686.49
22/09/202131/08/202241,754.615,219.338,350.92  11.003,795.87474.48759.17
22/09/202131/08/2022237,962.0329,745.2547,592.41  11.0021,632.912,704.114,326.58
22/09/202131/08/2022785.4198.18157.08  11.0071.408.9314.28
01/11/202131/10/202257,557.507,194.69-    12.004,796.46599.56-  
01/11/202131/10/202233,012.024,621.686,602.40  12.002,751.00385.14550.20

MurrayFD_0-1657278862019.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous ,

For M- Refer if this can help

https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2

 

For DAX

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

For M- Refer if this can help

https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2

 

For DAX

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

Thank you, I will take a look

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.