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
karabryan
Helper I
Helper I

Running Total by Year and By Plant Issue

I am fairly new to PowerBI and have seen the topics on running totals by year.  I am using the following but don't get a running total every time and when it does work (it will work at points and then revert back to unsummed data), I am not able to use it in another calculation because it does not appear as a field to select from.  I am trying to calculate inventory turns.

 

Here is the table format:

Company | DateTable.SortDate (I've also tried DateTable.Date) | InvTurnsInv | InvTurnsCOGS

 

I need a column that returns the running total of the InvTurnsInv column by year for each company.  I also need another column that allows me to use that new column in an inventory turns calculation.

 

My date table is linked to my InvTurns Data table.

 

I am using the following formula:

 

InvTurnsYTD =
TOTALYTD(SUM('InventoryTurnsCOGS'[INVTURNSINV]), 'DateTable'[Date])
 
This worked for me in a table where I needed a running total on Accounts Receivables but same thing - I can't use this running total in a formula for another calculated field.
 
Any help would be appreciated!!

 

4 REPLIES 4
parry2k
Super User
Super User

@karabryan sorry not sure what you mean by running total not work for another calculated columns, please provide more details. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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.

When writing the formula for the calculated field that will use the running total calculated field, I don't see that column name available in the drop down of fields associated with my table to use in my formula.

@karabryan can you share sample data and expected out and how you tables are related if there is more than one. It will help to get you the solution.



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.

 
InvBalTurns3 = TOTALYTD(SUM(InvTurnsCOGS[INVTURNSINV]), 'DateTable'[Date]))
 
 

1 to Many relationship between DateTable and InvTurnsCOGS table with Date being the matching field in both tables

 

Column headers are as follows:

 

InvTurnsCOGSCompany    InvTurnsCOGSSortDate     InvTurnsCOGSINVTURNSINV     INVTURNSCOGS     InvBalTurns3

Wurtec                                          2/1/2019                              100                                            10                   YTD Formula above

Wurtec                                          3/1/2019                              -50                                             11         

WURCAN                                       2/1/2019                              90                                             9

WURCAN                                       3/1/2019                              20                                              11

 

 

Due to company policy, I can't share the data I'm working with so hopefully this helps.  I want to sum InvTurnsCOGSINVTURNSINV YTD for each company and over each year (my table has data from 2016-current day).  The results will live in the INVTURNSCOGS column.  I then need to add a new column to look at the average InvBalTurns3 on a rolling 3-month basis so that I can add another column and calculate inventory turns.

 

@parry2k 

 

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.