Forum Discussion

Ortignano's avatar
Ortignano
Icon for Helper II rankHelper II
2 years ago
Solved

How plot sames series in 2 line chart

Hello,

I have a measure calculated each month from 2018 up today. I would plot a series for 2022 and one series for 2023 to compare them (in simila rway to the chart below). Do you have any suggestion? (create 2 sereies, 1 filter for 2022 and 1 filtered for 2023 it seems doesn't work as my measure take in count the latest 12 months).

Thnak you

 

onth but I would compare last 2 years creating a chart as attached

 

onth but I would compare last 2 years creating a chart as attached

  • Hi, Ortignano 

     

    You can try the following methods.

    Sample data:

    Need to create a new date table.

    Date = CALENDAR(DATE(2022,1,1),DATE(2023,12,31))

    Measure 2022 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),[Year]=2022&&[Month]=SELECTEDVALUE('Date'[Month])))
    Measure 2023 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),[Year]=2023&&[Month]=SELECTEDVALUE('Date'[Month])))

    Is this the result you expect? If not, please provide more details.

     

    Best Regards,

    Community Support Team _Charlotte

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

2 Replies

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Ortignano 

     

    You can try the following methods.

    Sample data:

    Need to create a new date table.

    Date = CALENDAR(DATE(2022,1,1),DATE(2023,12,31))

    Measure 2022 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),[Year]=2022&&[Month]=SELECTEDVALUE('Date'[Month])))
    Measure 2023 = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Date'),[Year]=2023&&[Month]=SELECTEDVALUE('Date'[Month])))

    Is this the result you expect? If not, please provide more details.

     

    Best Regards,

    Community Support Team _Charlotte

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

  • hank you it can work, bt thge way I solved creating a measure using 

    Measure Prior Year = CALCULATE([Measure],SAMEPERIODLASTYEAR('Calendar Lookup'[Date]))
    It dosn't give me the initial day but it can be sufficient for now