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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kitala11
Helper III
Helper III

Spread Cost over Month (accounting for number of days in each month)

https://community.powerbi.com/t5/DAX-Commands-and-Tips/Spreading-Budgeted-Cost-Across-Months/m-p/736... 

I have taken look at this post and some other posts. However, i get errors or it does not solve what I am trying to do.

What I am trying to do with my data is very similar to the linked post.

 

For example. in this image the cost impact date is 18/01/2021 and the amount is 1,000. Thus, I am trying to get similar to the link above in that, I am able to show for the next 12 months (default all will have an impact for 12 months). Thus if over the next year there is 365 days (366 for leap years). The calculated amount in January will vary by its days 14/365 * 1000, februrary will be 28/365*1000.

kitala11_0-1612415592024.png

 

I wish for the final presented format to be something like what the other post has in a table format.

Let me know if you need to sample data. can't seem to find an attach file button so here is a screenshot

 

kitala11_1-1612415978370.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kitala11 , I have blog how distribute data in month using measure

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

 

And attached file after signature as a new table 

 

Add a end date to get second date

end date =

var _min = [line cost impact date]

return

date(year(_min) ,month(_min) +12,day(_min) )

 

or start date .. depending on need

 

start date =

var _min = [line cost impact date]

return

date(year(_min) ,month(_min) -12,day(_min) )

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@kitala11 , I have blog how distribute data in month using measure

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

 

And attached file after signature as a new table 

 

Add a end date to get second date

end date =

var _min = [line cost impact date]

return

date(year(_min) ,month(_min) +12,day(_min) )

 

or start date .. depending on need

 

start date =

var _min = [line cost impact date]

return

date(year(_min) ,month(_min) -12,day(_min) )

Hi, thank you! This works but are there alternative methods? The loading duration for this is extremely long ( I will eventually have over million rows of data so with my current 100,000 is already taking a few minutes)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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