Forum Discussion
guibenassi
6 years agoAdvocate II
Conditional calculated with date
I have made this measure to get the value of [Custo_tabela-Un] in case that there is no number in a respective date, in this case I look for the previous date to populate the columm, and if there is ...
- 6 years ago
Hi guibenassi
Create a measure
Measure = CALCULATE(FIRSTNONBLANK('Table'[value],0),FILTER(ALLSELECTED('calendar'),'calendar'[Date]<MAX('calendar'[Date])))Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-juanli-msft
6 years agoCommunity Support
Hi guibenassi
Create a measure
Measure = CALCULATE(FIRSTNONBLANK('Table'[value],0),FILTER(ALLSELECTED('calendar'),'calendar'[Date]<MAX('calendar'[Date])))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
guibenassi
6 years agoAdvocate II
Thanks for the measure. I did just a few improvement to works best.
I include the = in the MAX calendar date and insert an IF for the first value provided.
Above the complete new measure.
Thanks a lot for the solution
Custo_Tab_Un_Corrig =
VAR Branco = CALCULATE(
FIRSTNONBLANK(tmp_vendas_teste[custo_tabela_un];0);
FILTER(
ALLSELECTED(dCalendario[Date]);
dCalendario[Date]<=MAX(dCalendario[Date])
)
)
RETURN
IF(
Branco=0;
sum(tmp_vendas_teste[custo_tabela_un]);
Branco
)