Greetings,
I've been banging my head on this for quite some time now. I've tried many different paths and none are getting me where I want to be.
I have a huge set of data (pulled from SharePoint) which I'm doing a lot of manipulation to within PowerQuery and spitting out a table.
That data is being plot to a chart and I can create a trend line there exactly like I want it.
However, I have another chart that is essentially an "Executive Dashboard" overview of the "lower level" charts which displays essential information on each column, with each column's data coming from the data of other charts.
Example Tables which get generated from multiple PowerQueries
Phase A
Title Time_to_process_days ProcessType INDEX
System A 100 ProcessA 1
System B 35 ProcessB 2
System C 85 ProcessA 3
Phase B
Title Time_to_process_days ProcessType INDEX
System A 15 ProcessA 1
System B 65 ProcessB 2
System C 50 ProcessA 3
Executive Chart
Combo chart with each series being a different marker
Series for MAX, MIN, Target, Average, StandardDeviation
My initial idea was to use the subtotal row on each table to calculate slope
So I added an Index column to my PowerQuery which added the Index column you see above.
=Slope(Time_to_process_days, INDEX)
This works, except I want the formula to respect the filtering of "ProcessType" but the slope function doesn't do that inherently like the subtotal or aggregate functions can do.
So, I added a column (outside powerQuery because PQ couldn't do it) to each table called isVisible and used the formula
=Subtotal(3, [Title])
and then I changed my slope function to (and used the CTRL+SHIFT+ENTER to enter)
{=SLOPE(Phase A[Time_to_process_days],IF(Phase A[isVisible],Phase A[Index],""))}
And this APPEARS to work. However, when I filter the ProcessType for (say) Process A I get this
Phase A
Title Time_to_process_days ProcessType INDEX
System A 100 ProcessA 1
System C 85 ProcessA 3
Phase B
Title Time_to_process_days ProcessType INDEX
System A 15 ProcessA 1
System C 50 ProcessA 3
So what happens is, it screws up the SLOPE calculation because the X-value goes from {1,3}, instead of {1,2}
Basically, I need to be able to calculate SLOPE of data that DOESN'T have an X value, and have it assume the x is 1->count. I tried passing the ROW(1:count) function to the x-values, but it can't do that.
The end goal is to then take the SLOPE that is calculated (based on the filtered data set) and plop that as a graph element on the Executive Graph. Something like an "Up Arrow" or "Down Arrow". And this is a whole new adventure to figure out. Right now I just need to get my slope calculations done correctly.
Enough details?
Bookmarks