How can I show cumulative percentage or sum of an attribute in a line chart power bi

95 Views Asked by At

I have a business requirement to show the trend of cumulative percentage of an atribute over last 2 years. I used a measure to create running total of the attribute for this year and the results are correct.However When I tried to apply the same logic for the past 2 years it is giving me incorrect values.I have created a date table that spans from 2021 to 2023 dec and The X axis of the chart displays weeknumber.Could some one help me with this issue?

Thanks in Advance!

The measure for this year :

Cumulative2023 = 
CALCULATE(
  DIVIDE(
        'Table'[CY CountNum2023]
       ,'Table'[CY CountDen2023]
       ,0),
 FILTER(
   ALLSELECTED('Table'),
  'Table'[CreatedDate] <= MAX('Table'[CreatedDate])
 )
)
0

There are 0 best solutions below