cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## How to split the budget amount by month using start date and end date?

Hi champs,

I am very new to PowerBI and stuck with a challenge in the first week of my new job.

I have a dataset consisting of budget data by projects. Some of the fields include Project Owner, Project Name, Start Date, End Date and Budget amount.

All I want to do is to calculate the budget amount by month and year.

The image given is a dummy data (due to confidentiality issues, I cant share the original data here)

As per the image, I need to show the budget for each year and month

It will be:

a) Project ABC : GBP16,667 per year and GBP 1,379 per month (100,000 / 73 months)

b)Project XYZ : GBP5,000per year and GBP 5,000 per month (5,000/1 month)

Thanks,

Alina

1 ACCEPTED SOLUTION
Community Support

Hi @AlinaJacon ,

According to your description, you want to show the budget for each year and month, right? Here are my steps you can follow as a solution.

(1)This is my test data.

(2)We can create  new columns.

``GBP Per Month = DIVIDE('Table'[Budget], IF( DATEDIFF('Table'[Project Start Date],'Table'[Project End Date],MONTH) =0, 1,DATEDIFF('Table'[Project Start Date],'Table'[Project End Date],MONTH)))``

``GBP Per Year = DIVIDE('Table'[Budget], IF( YEAR('Table'[Project End Date])- YEAR('Table'[Project Start Date]) =0 ,1,YEAR('Table'[Project End Date])- YEAR('Table'[Project Start Date])))``

(3) Then the result is as follows.

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Best Regards,

Neeko Tang

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

3 REPLIES 3
Community Support

Hi @AlinaJacon ,

According to your description, you want to show the budget for each year and month, right? Here are my steps you can follow as a solution.

(1)This is my test data.

(2)We can create  new columns.

``GBP Per Month = DIVIDE('Table'[Budget], IF( DATEDIFF('Table'[Project Start Date],'Table'[Project End Date],MONTH) =0, 1,DATEDIFF('Table'[Project Start Date],'Table'[Project End Date],MONTH)))``

``GBP Per Year = DIVIDE('Table'[Budget], IF( YEAR('Table'[Project End Date])- YEAR('Table'[Project Start Date]) =0 ,1,YEAR('Table'[Project End Date])- YEAR('Table'[Project Start Date])))``

(3) Then the result is as follows.

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Best Regards,

Neeko Tang

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

Memorable Member

Hi @AlinaJacon,

Use this DAX Code to create a new column:

``GBP Per Month = 'Table'[Budget]/(DATEDIFF('Table'[Start Date],'Table'[End Date],MONTH)+1)``

Result:

Works for you? Mark this post as a solution if it does!

Super User

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

#### Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors