Forum Discussion

Jean_D's avatar
Jean_D
New Member
4 years ago

Line chart does not show correct measure

Hello!

 

I'm having trouble with my column-line chart.

I have a measure thats calculate the average of the last 3 sales periods and this is working perfectly.

My X axis is month period and I have data from jan-2017 to jul-2022. I need to show the last year. 

When I use a filter and select only the last year, the first 2 months doesn't show the correct value and its calculate the first month as the first sale however I have more sales before that date.

 

If I move the filter it is corrected.... 

 

This is my code.

 

AVERAGEX(
    DATESINPERIOD('Calendar Table'[Date],MAX('Calendar Table'[Date]),-3,MONTH),
    CALCULATE(SUM('Sales'[Sales]),REMOVEFILTERS('Calendar Table'[Month-Year]))
    )
 
Incorrect Values.

 

 

 

Correct Values.

 

Please I need help, any possible solution

1 Reply

  • Jean_D do you have calendar table marked as a date table? Which table you are using to apply the filter for the year ?

     

    Follow us on LinkedIn and  to our YouTube channel

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.