Forum Discussion
Urgent arrow indicator error
Hi guys!
I am trying to create a column in my table with some arrows to indicate if the value of the last month has increased or decreased from the previous month, but I am facing the error below. Here's an example of what I would like to present and my developed DAX.
DAX ERROR:
EXPECTED EXAMPLE:
MY DAX:
Setas =
var LastData = CALCULATE([Montante Real Por Data RNA/CNA],FILTER(FATO_AR,MONTH(FATO_AR[NOVO_CORTE]) = MAX(MONTH(FATO_AR[NOVO_CORTE])
)))
var LastData1ant = CALCULATE([Montante Real Por Data RNA/CNA],FILTER(FATO_AR,MONTH(FATO_AR[NOVO_CORTE]) = MAX(MONTH(FATO_AR[NOVO_CORTE])-1
)))
var Evolucao = IF (LastData1ant = BLANK(),BLANK(),LastData1ant-LastData)
VAR Down =
UNICHAR ( 9660 )
VAR Up =
UNICHAR ( 9650 )
VAR Side =
UNICHAR ( 9655 )
RETURN
IF(Evolucao>0,Down,IF(Evolucao = 0,Side,IF(Evolucao = BLANK(),Side,Up)))
Hi Anonymous ,
Try the measure below:
Setas = VAR LastData = CALCULATE ( [Montante Real Por Data RNA/CNA], FILTER ( FATO_AR, FATO_AR[NOVO_CORTE].[MonthNo] = MAX ( MONTH ( FATO_AR[NOVO_CORTE].[MonthNo] ) ) ) ) VAR LastData1ant = CALCULATE ( [Montante Real Por Data RNA/CNA], FILTER ( FATO_AR, FATO_AR[NOVO_CORTE].[MonthNo] = MAX ( MONTH ( FATO_AR[NOVO_CORTE].[MonthNo] ) - 1 ) ) ) VAR Evolucao = IF ( LastData1ant = BLANK (), BLANK (), LastData1ant - LastData ) VAR Down = UNICHAR ( 9660 ) VAR Up = UNICHAR ( 9650 ) VAR Side = UNICHAR ( 9655 ) RETURN IF ( Evolucao > 0, Down, IF ( Evolucao = 0, Side, IF ( Evolucao = BLANK (), Side, Up ) ) )Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-joesh-msftSolution Sage
Hi Anonymous ,
Try the measure below:
Setas = VAR LastData = CALCULATE ( [Montante Real Por Data RNA/CNA], FILTER ( FATO_AR, FATO_AR[NOVO_CORTE].[MonthNo] = MAX ( MONTH ( FATO_AR[NOVO_CORTE].[MonthNo] ) ) ) ) VAR LastData1ant = CALCULATE ( [Montante Real Por Data RNA/CNA], FILTER ( FATO_AR, FATO_AR[NOVO_CORTE].[MonthNo] = MAX ( MONTH ( FATO_AR[NOVO_CORTE].[MonthNo] ) - 1 ) ) ) VAR Evolucao = IF ( LastData1ant = BLANK (), BLANK (), LastData1ant - LastData ) VAR Down = UNICHAR ( 9660 ) VAR Up = UNICHAR ( 9650 ) VAR Side = UNICHAR ( 9655 ) RETURN IF ( Evolucao > 0, Down, IF ( Evolucao = 0, Side, IF ( Evolucao = BLANK (), Side, Up ) ) )Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.