Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Vilmar
Resolver I
Resolver I

Valor do Dia Anterior Respeitando os Filtros

Medida para trazer o valor do dia anterior, porem respeitando os filtros
Medida que fiz:

Anterior =
CALCULATE (
    [Receita];
    FILTER (
        _dCalendario;
        _dCalendario[Data].[Dia] < MAX ( _dCalendario[Data].[Dia] )
    )
)

Preciso chegar ao resultado abaixo

Sem título.png

O arquivo pbix aqui 

1 ACCEPTED SOLUTION

Tente essa medida...


Valor anterior =
CALCULATE(
MAX(Divergencia[Qtd]),
TOPN(1,
FILTER(
ALLSELECTED(Divergencia),
Divergencia[DataVenda] < MAX(Divergencia[DataVenda] )
),
Divergencia[DataVenda],
DESC
)
)

View solution in original post

3 REPLIES 3
Portrek
Resolver III
Resolver III

Fala Vilmar.


Se você quiser um valor continuo atraves do tempo, coloque a medida abaixo..


Acumulado Continuo =
CALCULATE (
SUM ( Divergencia[Qtd]),
FILTER (
ALL (_dCalendario ),
_dCalendario[Data] <= MAX ( _dCalendario[Data] )
)
)

Mas se vc quiser a partição por período de filtro construa a medida assim

Acumulado com filtros =
CALCULATE (
SUM( Divergencia[Qtd]),
FILTER (
ALLSELECTED ( _dCalendario ),
_dCalendario[Data] <= MAX ( _dCalendario[Data] )
)
)

 

 

Flw !!

@Portrekobrigado pela resposta, mas o que preciso não é o acumulado e sim o valor que tinha no dia anterior.
Veja que no dia 7 a receita é 3. Preciso que nesta linha traga o valor do dia 5 que é 14

Tente essa medida...


Valor anterior =
CALCULATE(
MAX(Divergencia[Qtd]),
TOPN(1,
FILTER(
ALLSELECTED(Divergencia),
Divergencia[DataVenda] < MAX(Divergencia[DataVenda] )
),
Divergencia[DataVenda],
DESC
)
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors