Forum Discussion

amirghaderi's avatar
amirghaderi
Icon for Helper IV rankHelper IV
6 years ago

Stop Cumulative count curve

Hi,

I have seen a lot post on this subject. but, could not get a clear answer.

I have a measure which count a column record, there is a cumulative count measure which I want to stop once it reaches its Maximum and not to continue as a flat line.

Data table as below:

CriteriaDate
MDR Issue DateFriday, 19 June 2020
MDR Planned Finish DateMonday, 8 June 2020
MDR Issue DateFriday, 26 June 2020
MDR Planned Finish DateMonday, 8 June 2020
MDR Issue DateFriday, 5 June 2020
MDR Planned Finish DateMonday, 8 June 2020
MDR Issue DateFriday, 26 June 2020
MDR Planned Finish DateThursday, 11 June 2020
MDR Issue DateMonday, 15 June 2020
MDR Planned Finish DateTuesday, 30 June 2020
MDR Issue DateFriday, 3 July 2020
MDR Planned Finish DateThursday, 11 June 2020
MDR Issue DateMonday, 15 June 2020

 

Issued Count =

    calculate(COUNT('t_MDR2'[Date]),t_MDR2[Criteria] = "MDR Issue Date")
 
Issued **bleep**. =
CALCULATE(
    [Issued Count],
FILTER(
        ALLSELECTED('t_MDR2'),
        't_MDR2'[Date]<= MAX(t_MDR2[Date])))
 
 

11 Replies

    • amirghaderi's avatar
      amirghaderi
      Icon for Helper IV rankHelper IV

      Hi, thanks for the response. getting closer now. 

      I dont have the option to attached the file.

      I think I cant get the same result since my count data is measure.

      So, assume in your file the value table has three columns, as below. I want to count the cumulative value of "Issued" and "planned" as two curve over the date

      DocumentCriteriaDate
      AIssuedFriday, 19 June 2020
      BPlannedMonday, 8 June 2020
      CIssuedFriday, 26 June 2020
      DIssuedMonday, 8 June 2020
      EPlannedFriday, 5 June 2020
      FIssuedMonday, 8 June 2020
      GIssuedFriday, 26 June 2020
      HIssuedThursday, 11 June 2020
      IPlannedMonday, 15 June 2020
      JPlannedTuesday, 30 June 2020
      KPlannedFriday, 3 July 2020
      LPlannedThursday, 11 June 2020
      MIssuedMonday, 15 June 2020
      • v-yingjl's avatar
        v-yingjl
        Icon for Community Support rankCommunity Support

        Hi amirghaderi ,

        Try like this measure:

        Issued Count = 
        IF (
            SELECTEDVALUE ( 'Table'[Date] )
                <= CALCULATE (
                    MAX ( 'Table'[Date] ),
                    FILTER ( ALL ( 'Table' ), 'Table'[Criteria] = "Issued" )
                ),
            CALCULATE (
                COUNT ( 'Table'[Date] ),
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Date] <= MAX ( 'Table'[Date] )
                        && 'Table'[Criteria] = "Issued"
                )
            )
        )

         

        Attached my sample file that hopes to help you: Stop Cumulative count curve.pbix

         

        Best Regards,
        Yingjie Li

        If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

  • Hi amirghaderi ,


    Are you using a separate a date field from a separate Date table in  your graph? You can modify your formula  a bit so the value only shows when ony when the date from a separate table is <= the date from your fact table. Try this.

    Issued **bleep**. =
    IF (
        LASTDATE ( Dates[Date] )
            <= CALCULATE ( MAX ( 't_MDR2'[Date] ), ALL ( 't_MDR2' ) ),
        CALCULATE (
            [Issued Count],
            FILTER ( ALLSELECTED ( 't_MDR2' ), 't_MDR2'[Date] <= MAX ( t_MDR2[Date] ) )
        )
    )
    

     

  • If you look at the graph, the green curve has been extended as a flat line once it has reached its maximum value. i want that to finish once it reaches its max value