Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Trend line chart

Hi All,

 

My table looks like below.

 

MonthCount
September10
October5

 

My target per month is 15

September15
October30
November45
December60
January75
Februrary90
March105
April120
May135
June150
July165
August180

 

 

End table should be like this. and when i put this Trend line it should show like below

 

MonthTargetActuals - Cummulative
September1510
October3015
November45 
December60 
January75 
Februrary90 
March105 
April120 
May135 
June150 
July165 
August180 

 

 

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    Please update the formula of your measure as below and check whether it can get your expected result.

    Measure =
    CALCULATE (
        COUNT ( 'p1'[Name] ),
        FILTER (
            ALLSELECTED ( 'p1' ),
            'p1'[Fiscal Month] <= SELECTEDVALUE ( 'p1'[Fiscal Month] )
        )
    )

    By the way, what's the data type of field [Fiscal Month]? It is Numeric or Text type? If it is Text type, the above measure will not return the correct result...

    Best Regards

3 Replies

  • Anonymous , You need to have a common month /date table. Create a date from the month and then join that with date table on the axis.

     

    for the first table, you need cumulative measures. Second one you can use as is 

     

     

    Cumm = CALCULATE(SUM('Table'[Count]),filter(allselected(date),date[date] <=max(date[Date])))

    • Anonymous's avatar
      Anonymous
      Not applicable
      I have tried calculating cumulative with this query 
      CALCULATE
      (
      COUNT('p1'[Name]),
      FILTER (
      ALLSELECTED ('p1'[Fiscal Month]),
      'p1'[Fiscal Month] <= MAX ('p1'[Fiscal Month])
      )
      )
       
      but I'm getting below output
       
      MonthCumm
      September10
      October5
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

        Please update the formula of your measure as below and check whether it can get your expected result.

        Measure =
        CALCULATE (
            COUNT ( 'p1'[Name] ),
            FILTER (
                ALLSELECTED ( 'p1' ),
                'p1'[Fiscal Month] <= SELECTEDVALUE ( 'p1'[Fiscal Month] )
            )
        )

        By the way, what's the data type of field [Fiscal Month]? It is Numeric or Text type? If it is Text type, the above measure will not return the correct result...

        Best Regards