Forum Discussion
Creating a Cumulative Histogram
- Anonymous7 years ago
Ok to achieve this we need an AGE table, which simply has a column called "Age(Days)" with a unique values from 1 to the number of days you want in the graph. Link this to Table1 in your table relationships.
Create this measure:
Cumulative Measure = VAR currentAge = max(Age[Age (Days)]) RETURN CALCULATE( COUNTROWS(Table1), ALL(Table1), Table1[Age (days)] > currentAge )
Create a line graph using these settings:
Axis - 'Age'[Age(Days)]
Values - The measure we created
You'll get this:
That's great! Thank you for your help :)
Follow up question
How would I add a bar to show the target days? When I tried the bar was horizontal instead of vertical.
I updated the proposed function to allow for outside filters.
Cumulative Measure = VAR currentAge = max(Age[Age (Days)])
RETURN
CALCULATE(
COUNTROWS(Table1),
ALLSELECTED(Table1),
Table1[Age (days)] > currentAge
)
This is what I would like it to look like.
Great suggestion on your alteration to the code. Its great to see you getting your head around the code and tweaking it to your scenario.
I can't think of an easy way to create the line you want. Most of the trending are all hoziontal lines. Its possible to use the "Line and Clustered Column chart" to have vertical lines, so my thoughts are to using that some how.