Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
Sample data looks something like this:
StartPeriod | CancellationTiming |
A | 1 |
A | 1 |
A | 2 |
A | 3 |
A | |
A | 6 |
A | |
A | |
A | 10 |
A | |
B | 1 |
B | 1 |
B | 1 |
B | 3 |
B | 7 |
B | |
B | |
B | |
B | |
B | |
C | 1 |
C | 2 |
C | 2 |
C | 4 |
C | 5 |
C | |
C | |
C | |
C | |
C |
What I need to do is create a count of the number of entries in the CancellationTiming column and plot them against an x-axis running from 1-12, with the y-axis indicating the count of rows which have a timing less than or equal to each relevant x-axis point and (this is what I'm having trouble with) have the line stop at the last point at which there is an entry. So something like this is the desired end product:
I have the x-axis on a separate table (just a list of numbers from 1-12), and the DAX measure I'm using is this:
CumulativeCancellations =
var stoppoint = max([CancellationTiming])
var nullpoint = if(stoppoint = max(MonthTable[MonthNumber]), blank(), 2)
return min (nullpoint, calculate(countrows(MainTable), MainTable[CancellationTiming]<>blank(), MainTable[CancellationTiming]<=max(MonthTable[MonthNumber])))
However that just runs the line all the way from 1-12 and ignores the attempted logic telling it to stop. What am I doing wrong?
Hi @jthomson ,
Seems a bit strange, what field is MonthTable[MonthNumber] in the formula you provided?
Best Regards,
Adamk Kong
It's an unconnected table containing the numbers 1-12.
User | Count |
---|---|
79 | |
74 | |
44 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |