I am trying to visualize yearly change of the value. I encountered one problem, everything works fine until I get to the 2018. I've got missing data from April 2018 and it keeps on lowering my yearly change because the data is summarising whole year. Please have a look at the code first:
here you can find how my calculations are done and the matrix shows the results for each month, unfortunatelly the card summarises it all and prints the summary for all year, regardless from its availability. I would also like ot make it flexible, as soon as i manage to fetch new data, I would like it to adjust.
I tried various methods like trying to filter max(month) od max(date) although neither of the ways worked, hope you can suggest me something.
I encounter similar situations frequently, and my pattern is to always create a measure which I call Pivot Date. Pivot Date contains the latest date of historical data. Use whatever logic you need to arrive at this date. Then you can use a statement like min(pivot date, max(date dimension)) to filter your dates to the proper cutoff. This will work properly for prior and current years.
Pivot Date is very handy for doing prior period to-date calculations or if you're doing forecasting and need future dates in your calendar but also need to keep track of the cutoff of historical actuals.