Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello good,
create a measure to calculate the treatment field for each row taking into account the ticket field of the previous and subsequent rows, taking into account that a filtering is carried out with the following measure, showing the results that are 1.
Thans!!
Solved! Go to Solution.
Hi @fjgarcia85 ,
I’d like to acknowledge the valuable input provided by @lbendlin . His initial ideas were instrumental in guiding my approach. However, I noticed that further details were needed to fully understand the issue.
In my investigation, I took the following steps:
I create two tables as you mentioned.
Then I create a measure by using your DAX codes.
filtro =
IF (
(
SELECTEDVALUE ( 'public h_cercoer_pendings'[fecha] ) >= MAX('Date'[fecha_minima])
&& SELECTEDVALUE ( 'public h_cercoer_pendings'[fecha] ) < MAX('Date'[fecha_maxima])
),
1,
0
)
Fianlly I create a calculated column to achieve your requirements.
Column =
VAR _CurrentTicket =
SELECTEDVALUE ( 'public h_cercoer_pendings'[ticket] )
VAR _PreviousTicket =
CALCULATE (
MAX ( 'public h_cercoer_pendings'[ticket] ),
FILTER (
ALL ( 'public h_cercoer_pendings' ),
'public h_cercoer_pendings'[ticket]
< EARLIER ( 'public h_cercoer_pendings'[ticket] )
)
)
RETURN
_PreviousTicket
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @fjgarcia85 ,
I’d like to acknowledge the valuable input provided by @lbendlin . His initial ideas were instrumental in guiding my approach. However, I noticed that further details were needed to fully understand the issue.
In my investigation, I took the following steps:
I create two tables as you mentioned.
Then I create a measure by using your DAX codes.
filtro =
IF (
(
SELECTEDVALUE ( 'public h_cercoer_pendings'[fecha] ) >= MAX('Date'[fecha_minima])
&& SELECTEDVALUE ( 'public h_cercoer_pendings'[fecha] ) < MAX('Date'[fecha_maxima])
),
1,
0
)
Fianlly I create a calculated column to achieve your requirements.
Column =
VAR _CurrentTicket =
SELECTEDVALUE ( 'public h_cercoer_pendings'[ticket] )
VAR _PreviousTicket =
CALCULATE (
MAX ( 'public h_cercoer_pendings'[ticket] ),
FILTER (
ALL ( 'public h_cercoer_pendings' ),
'public h_cercoer_pendings'[ticket]
< EARLIER ( 'public h_cercoer_pendings'[ticket] )
)
)
RETURN
_PreviousTicket
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
read about the WINDOW function.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.