Forum Discussion

manojk_pbi's avatar
manojk_pbi
Helper V
1 year ago
Solved

Help - Trend chart

Hi Friends,

 

I have below data in model. How can we draw a line chart showing only Dec data of previous years and all months of the current year.

 

MMMYYForecastActualCost
6/1/202331000041813.68764
7/1/202331000075897.3089
8/1/202331000040003.10025
9/1/2023310000117452.1421
10/1/202331000056190.15467
11/1/202331000072202.93116
12/1/2023310000128021.534
1/1/20242970000
2/1/202429700027656.29
3/1/202429700043518.46
4/1/202429700068786.15
5/1/2024297000119160.89
6/1/2024297000139212.38
7/1/2024297000143467.36
8/1/2024297000163607.49
9/1/2024297000188824.68
10/1/2024297000225715.05
11/1/2024297000269808.53
12/1/2024297000296341.22
1/1/20256120000
2/1/202561200026275.19
3/1/202561200085800.02
4/1/2025612000116936.47
5/1/2025612000160379.43
6/1/2025612000187654.78
7/1/2025612000207702.24
8/1/2025612000207702.24
9/1/2025612000207702.24
10/1/2025612000207702.24
11/1/2025612000207702.24
12/1/2025612000207702.24
  • Hello manojk_pbi 

     

    One of the solutions would be to create one Calculated column in the table with below logic,

    flag = 
    VAR CurrentYear = YEAR(TODAY())
    VAR RowYear = YEAR([MMMYY])
    VAR RowMonth = MONTH([MMMYY])
    RETURN
    IF(
        RowYear = CurrentYear,                  
        TRUE(),
        IF(
            RowYear < CurrentYear,              
            RowMonth = 12,                      
            FALSE()                                 )
    )

     

    and use this flag column as a visual level filter as in below picture.

    Hope this helps:) 

  • Thanks for your reply. It is helpful. I am changing the graph to column chart in which we can avoid other months

2 Replies

  • Hello manojk_pbi 

     

    One of the solutions would be to create one Calculated column in the table with below logic,

    flag = 
    VAR CurrentYear = YEAR(TODAY())
    VAR RowYear = YEAR([MMMYY])
    VAR RowMonth = MONTH([MMMYY])
    RETURN
    IF(
        RowYear = CurrentYear,                  
        TRUE(),
        IF(
            RowYear < CurrentYear,              
            RowMonth = 12,                      
            FALSE()                                 )
    )

     

    and use this flag column as a visual level filter as in below picture.

    Hope this helps:) 

    • manojk_pbi's avatar
      manojk_pbi
      Helper V

      Thanks for your reply. It is helpful. I am changing the graph to column chart in which we can avoid other months