Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Issue with cumulative count

Hi All, 

 

I'm encountering a slight issue with my calculation. I have the below table. I need to get a cumulative count where Proposal Type = A, however, i need to ignore the rows where Proposal Date is BLANK. 

 

When i use the below calculation, it's cumulating on the blank Proposal Date rows as well. Does anyone know how i can just do a cumulative count on the rows where there is an associated Proposal Date value?

 

Proposal DateProposal Type 
 A
1/1/21A
5/1/21B
 

A

 A
10/1/21A



My measure: 

CALCULATE (
COUNTROWS ( FILTER ( 'ProposalData', 'ProposalDate[ProposalType] = "A") ),
FILTER(ALL('ProposalData'), 'ProposalData'[ProposalDate] <= MAX('ProposalData'[ProposalDate])))
 
 
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous 

    try it

    CALCULATE (
    COUNTROWS ( FILTER ( 'ProposalData', 'ProposalDate[ProposalType] = "A" && 'ProposalData'[ProposalDate] <> BLANK() ) ),
    FILTER(ALL('ProposalData'), 'ProposalData'[ProposalDate] <= MAX('ProposalData'[ProposalDate])))

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    try it

    CALCULATE (
    COUNTROWS ( FILTER ( 'ProposalData', 'ProposalDate[ProposalType] = "A" && 'ProposalData'[ProposalDate] <> BLANK() ) ),
    FILTER(ALL('ProposalData'), 'ProposalData'[ProposalDate] <= MAX('ProposalData'[ProposalDate])))
    • Anonymous's avatar
      Anonymous
      Not applicable

      That worked perfectly! Thanks so much!