The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.