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
kkassel
Frequent Visitor

Line graph of running total by multiple slicer

I've been spinning my wheels too long with this one so hopefully someone is albe to assist. I'm trying to create a line graph that displays the running total of sales for the selected month and selected division. Ideally there are 2 slicers on the page, one for month and one for division. The line graph will show the cumultaive total of sales for the selected month and division with the day of the month on the x-axis and sales total as the y-axis. Below is a sample data set I'm working with. The 'Cuml Sales by month' column is what I've manually entered, that is the column I'm having issues getting correct. The result can be either a column or measure, I don't think it matters to me as long as I can plot it on the line graph. Thanks in advance

 

DivisionDateMonthDaySalesCuml Sales by Month
New York7/16/202371622
New York7/18/202371846
New York8/1/20238122
New York8/5/20238557
New York8/15/202381518
New York8/16/2023816311
New York8/21/2023821213
Washington7/20/202372022
Washington7/25/202372513
Washington8/2/20238255
Washington8/4/20238438
Washington8/10/202381019
Washington8/13/2023813413
Washington8/15/2023815215
Atlanta7/17/202371733
Atlanta7/21/202372114
Atlanta7/25/202372526
Atlanta8/5/20238511
Atlanta8/7/20238734
Atlanta8/9/20238926
Atlanta8/14/202381417
4 REPLIES 4
JoeBarry
Solution Sage
Solution Sage

Hi @kkassel 

 

for running total you can try if you have a date table 

 

 

MTD Total = TOTALMTD=SUM(Sales[SalesByMonth], DimDate[Date])

 

 

 or if you don't have a date table you can try this article https://community.fabric.microsoft.com/t5/Desktop/MTD-YTD-Calculation-on-Non-Standard-Date-tables/td...

 

Thanks

Joe 

 

If this post helps, then please Accept it as the solution 

 

Thanks for the quick response. Maybe my description wasn't clear but the 'Cuml Sales by month' column in the sample data is the column I'm trying to calcuate in power bi. In the sample data, I just manually added that so people could see what I'm looking to calculate. The examples you gave seem to be totaling that column but I need a measure or column coding that will calculate that for me.

Hi @kkassel 

 

My mistake, just change the meaasure to the [sales] column

 

JoeBarry_0-1692885435004.png

 

no worries. I had to add CALCULATE() function to beginning of string for the SUM() function to work but that seems to have done the trick. So simple in the end. I was trying to make it way too complicated. Thanks!

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.