Forum Discussion
mape
8 years agoFrequent Visitor
In a matrix, how I can replace values in empty cells with values of previous cells ?
Hi everyone!! I need help about this... Measure of sales per year and in case there is no information for that year, show the sales of the previous year. That is, given a series of sales per ...
mape
8 years agoFrequent Visitor
Hi Abduvali, I see but the proble is the same. If I replaced that field by a full date (named "Fecha") , finally the matrix shows the same result that I got before:
lastyear =
var l = SUM(Ventas[ImporteVenta])
var c = CALCULATE(SUM(Ventas[ImporteVenta]);FILTER(ALLSELECTED(Ventas[Fecha].[year]);Ventas[Fecha].[Year]-1))
return
if(l=BLANK();c;l)
the matrix result like:
| Nombre | 2016 | 2017 | Total |
| Customer1 | 37001 | 37001 | 74002 |
| Customer2 | 37001 | 37001 | 74002 |
| Customer3 | 37001 | 37001 | 74002 |
| Customer4 | 37001 | 37001 | 74002 |
| Customer5 | 37001 | 37001 | |
| Customer6 | 37001 | 37001 | 74002 |
| Customer7 | 37001 | 37001 | |
| Customer8 | 37001 | 37001 | 74002 |
| Total | 296008 | 222006 | 518014 |