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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Nese_FZ
Helper I
Helper I

OFFSET - understanding behavior in the context filters

Good afternoon, Could anyone help me understand the behavior of this new offset function considering the filters applied to the measurements used?

The "SALDO INICIAL 2" column should bring the previous value of the "SALDO ACUM" column, but only a few lines are returning.

 

SALDO INICIAL 2 =
CALCULATE([SALDO ACUM],
OFFSET(1,ALLSELECTED(SaudeDigital[LINHA]),
ORDERBY(SaudeDigital[LINHA], DESC)))
 
SALDO ACUM =
VAR MaxIndice = Max(SaudeDigital[LINHA])
return
CALCULATE([Variação],
FILTER(ALL(SaudeDigital), SaudeDigital[LINHA] <= MaxIndice), SaudeDigital[NRUBRICA] = "UN. SAÚDE DIGITAL")
 
Considering that I already have an external filter applied on this page....
 
Nese_FZ_0-1678732932612.png

thanks a lot for the help

5 REPLIES 5
Nese_FZ
Helper I
Helper I

Thanks Brian, but it didn't work. It's not that context. From what I'm seeing, what's influencing the behavior is the SALDO ACUM measure, because if I insert removefilters the problem is solved. But then I can't apply external filters (month for example)

Provide sample data, Ill take a stab at it.  I have worked with it before and have had success.

Your problem is not in the Offset.  If you are able to dimensionalize the transaction table where LINHA is a dimension along with the Nrubrica and Descricao da conta is as well.  I don't know the data enough, but know that in the offset you are using an all selected becuase of duplicate records, but in the ACUM you have specific filter criteria.

 

BrianConnelly
Resolver III
Resolver III

Please read the article....Introducing window functions in DAX - SQLBI

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors