Forum Discussion
Arranafc19
7 years agoHelper IV
Creating a Cumulative Line Chart
I am working on a report which calculates the percetage of cars sold per month , with the null value being the ones not sold. I have managed to create the below dataset and calculated the percetages ...
Arranafc19
7 years agoHelper IV
MFelix
7 years agoSuper User
Hi Arranafc19 ,
Try the following measure:
Cumulative % =
CALCULATE (
CALCULATE (
COUNTROWS ( DealerData );
FILTER (
ALL ( DealerData[MonthOfSale]; DealerData[Dealer] );
DealerData[MonthOfSale] <= MAX ( DealerData[MonthOfSale] )
);
DealerData[MonthOfSale] <> BLANK ()
)
)
/ CALCULATE ( COUNTROWS ( DealerData ); ALLSELECTED ( DealerData ) )
Based on the context of your table I had to redo the calculation in the cumulative.
Be aware that if you add another field for context like the dealer the formula will give repeated values for each of the months
Check result in PBIX file attach.
Regards,
MFelix
- MFelix7 years agoSuper User
Hi Arranafc19 ,
You are missing the blank filter on your measure try to rephrase to this:
Cumulative Total = CALCULATE ( COUNT ( 'Actual v Expected'[Count] ), FILTER ( ALLSELECTED ( 'Actual v Expected' ), 'Actual v Expected'[MONTH_OF_CLOSURE] <= MAX ( 'Actual v Expected'[MONTH_OF_CLOSURE] ) ), DealerData[MonthOfSale] <> BLANK () )Regards,
MFelix
- Arranafc197 years agoHelper IV
hi MFelix ,
this didnt work for me , however i have managed to get this far ..
I am working on calculating the cumulative percentage for a set of data , however I only want the percentage to start totalling after the first row.
At present , I am getting the below:
The current measure I am using is
Cumulative Total =CALCULATE (COUNT ( 'Actual v Expected'[Count] ),FILTER (ALLSELECTED ( 'Actual v Expected' ),('Actual v Expected'[MONTH_OF_CLOSURE] <= MAX ( 'Actual v Expected'[MONTH_OF_CLOSURE] ))))This is calculating the cumulative percentage correct but it is including my null month which I want to exclude.I need the measure to only start a running total on the rows where the month of closure is not null.See below the expected outcome:As you can see , i need only from 0.4 down on the percentage close to total up , and I cant exclude the top row as I need them in the percetnage calculation.