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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
jjmmesoj
New Member

Variação MoM

Bom dia!

 

Poderiam me ajudar com esse alert do Power Pivot? A medida traz a variação do mês atual vs mês anterior. Antes de subir dados de 2025 estava funcionando perfeitamente, mas quando insiro os novos dados a formula quebra. A Minha tabela dimensão calendário já possui dados até 31/12/2025.

 

Medida:

 

=VAR varMesAtual = [TME_s]
VAR varMesAnterior =
CALCULATE(
[TME_s];
DATEADD(dCalendario[Data]; -1; MONTH)
)
RETURN
DIVIDE(varMesAtual - varMesAnterior; varMesAnterior)

 

The query was not executed, or the Data Model could not be accessed. See the error message we received:

MdxScript(model) (10,2), Calculation error in measurement fCalls'[MoM_TME]: The 'DATEADD' function only works with contiguous date selections.

 

jjmmesoj_0-1736162215159.png

 

 

 

1 ACCEPTED SOLUTION
PurpleGate
Resolver III
Resolver III

It might mean there is a gap in your date table somewhere. 

You can try this instead: 

 

Measure = 
VAR varMesAtual = [TME_s]
VAR varMesPrevious =
CALCULATE(
[TME_s],
PARALLELPERIOD(dCalendario[Data], -1, MONTH)
)
RETURN
DIVIDE(varMesAtual - varMesPrevious, varMesPrevious)

 

View solution in original post

2 REPLIES 2
PurpleGate
Resolver III
Resolver III

It might mean there is a gap in your date table somewhere. 

You can try this instead: 

 

Measure = 
VAR varMesAtual = [TME_s]
VAR varMesPrevious =
CALCULATE(
[TME_s],
PARALLELPERIOD(dCalendario[Data], -1, MONTH)
)
RETURN
DIVIDE(varMesAtual - varMesPrevious, varMesPrevious)

 

Oi, Purple! Usei essa alternativa e realmente funcionou. Não sei por que cargas dáguas a outra não funcionava, mesmo com a Dimensão Calendário completa. Enfim, agradeço sua disponibilidade em ajudar aqui. Abraços do Brasil.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.