Forum Discussion
last value with conditional (zero)
HI folks
I want to repeat the last value when the actual value is numeral zero.
I tried to use with earlier, but unsuccessfully.
Tks
Igor
Hi igorabdo
If you want to have the average at the total there are two possibilities. I'm not sure which one you prefer.
One is that we take the average with the original zeros (i.e. without the filled-in values). Note that we are using the [Mesure_CUSTO] defined previously. You don't need to use it in the visual any longer but do keep the definition.
Measure_CUSTO_With_Avg@TotalWithOriginalZeros = IF ( ISFILTERED ( Table1[Mês Ano] ); [Measure_CUSTO]; AVERAGEX ( ADDCOLUMNS ( SUMMARIZE ( Table1; Table1[ITEMID]; Table1[Mês Ano] ); "Result"; CALCULATE ( SUM ( Table1[CUSTO] ) ) ); [Result] ) )
12 Replies
- AlBCommunity Champion
I get it now but i need more details to be able to work it out.
Can you share the pbix? That would be the quickest. Perhaps just with some dummy data if you have confidential data in it.
Otherwise:
1. What you are showing is a table visual? What are ITEMID, CUSTO, INVENTITEID and Mes Ano? Columns in your data table or measures? Is Mes Ano of type date or text?
2. If CUSTO is a measure I need to see its code.
3. Can you show a sample of your table(s) (not the visual, the table(s) itself). So that we can see the columns in it
- AnonymousNot applicable
Hi,
I am experiencing the same issue with the 0 value where i would like the measure to look for the last non zero value, I have used your measure above but it is not working do you know any reasons why this could be?