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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
questionpbi
Frequent Visitor

Creating a cumulative line from a single number/budget

Bascially, I just need a line that accumulates evenly over time(periods), and eventually end up on a total. Seems easy, but there are a few caveats.

questionpbi_2-1693362448644.png

 

Context:

  • The data shown below are an overly simplified oversion of what I'm working with. The actual data contain millions of entries and hundreds of columns.
  • "Period" here is essentially months. But because they're not calculated the exactly the same as calendar months, date related formulas would not apply.

 

Table 1: 

  • The empty rows in Table 1 are simulating how the data is captured in the database. Supposedly, we are at the end of period 5, and therefore, we only have the Period and Spending data generated up to period 5.
TeamPeriodSpending
11 $ 35,969.00
12 $ 55,478.00
13 $ 13,549.00
14 $ 57,476.00
15 $ 42,247.00
1  
1  
1  
1  
1  
21 $ 71,358.00
22 $ 35,969.00
23 $ 55,478.00
24 $ 35,969.00
25 $ 55,478.00
2  
2  
2  
2  
2  
31 $ 57,476.00
32 $ 42,247.00
33 $ 55,478.00
34 $ 13,549.00
35 $ 57,476.00
3  
3  
3  
3  
3  

Table 2:

  • Table 2 only contain the final budget amound for each employee. It is not linked to periods in the database.
TeamEmployee Budget 
1A $       93,839.00
1B $     154,593.00
1C $     193,405.00
2A $     158,394.00
2B $       83,849.00
2C $     138,405.00
3A $     158,394.00
3B $     145,937.00
3C $     138,405.00

 

 

Requirement:

  • I need a budget line that incrementally increases each period all the way to the last period where it meets the budget amount.
  • Have the expenditure and cumulative expenditure data shown on the same visual, and have the "Team" filter be applied to all compenents in the visual
    • The cumulative expenditure is already setup, the only issue here is getting the budget line to connect to the periods properly.

questionpbi_2-1693362448644.png

 

Additional thoughts:

  • My initial approach is to do "DIVIDE(SUM(Table2[Budget]), 10)" to get the amount per period, then accumulate this amount over each period. But I can't find a way to make it show properly in the visual, because these tables are not linked by periods in anyway
  • Another approach is to generate a "period" column or index for each team's budget totals. But I also failed to find an efficient way to do this.

 

This my first post and I've already searched for hours for a solution to this, but could not find one. I'm hoping I can get some answers from the community very soon. Thank you very much!

9 REPLIES 9
parry2k
Super User
Super User

@questionpbi this was clearly pointed out here, and then later I asked. Good luck!

 

super easy would be to add another table called Period with distinct values and then connect it with both the tables and also use it on the x-axis, problem solved.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@questionpbi I think if you follow what I explained and try we will not be going back and forth. If you are asking for help I would recommend first testing the solution provided to you.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Your previous reply was "did you create the period table with up to 10  periods and then use that on the x-axis and have a relationship with the Table 1." 

And I just answered with what I did...

But I think you meant to suggest that as a solution, not a question. I think you could have typed just a few more words to clearly communicate what you meant.

Either way, I'ved tried that, but ran into an unrelated issue in the actual data I'm working with.

Thank you

parry2k
Super User
Super User

@questionpbi did you create the period table with up to 10  periods and then use that on the x-axis and have a relationship with the Table 1.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

No, the relationship is simply this:

questionpbi_0-1693416742754.png

 

The reason why it shows 10 periods in the visual is because I manually changed the range of X axis to 10. I don't usually have to do this because in the real thing, I have other data and measures in there that goes up period 10.

parry2k
Super User
Super User

@questionpbi try this measure for Budget and use that for Line

 

Budget Measure = 
DIVIDE ( SUM ( Table2[Budget] ), 10 ) * SELECTEDVALUE ( Table1[Period Column] ) 


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

This worked up to period 5, but doesn't run all the way to period 10, because the future periods aren't yet in the system. It would have worked if I had the future periods already in there.

Do you know a good way to generate the future periods for each year?

 

questionpbi_0-1693413233877.png

 

parry2k
Super User
Super User

@questionpbi super easy would be to add another table called Period with distinct values and then connect it with both the tables and also use it on the x-axis, problem solved.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

There's no period to connect with in Table 2. If you mean something else, could you please show an example?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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