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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Good
I need to create a measure to calculate the "Treatment" field of each row taking into account the ticket field of the previous and subsequent rows, and that a filter is performed with the next measure, showing the results that are 1.
Best regards
Solved! Go to Solution.
Hi @Anonymous ,
Thanks for the quick response.
Hi @Syndicate_Admin ,
I have some information to add.
I have create a simple sample, please refer to my post to see if it helps you.
Measure = var _above=CALCULATE(MAX('Table'[Index]),FILTER(ALL('Table'),'Table'[Index]<SELECTEDVALUE('Table'[Index])))
var _abovere=CALCULATE(MAX('Table'[fecha]),FILTER(ALL('Table'),'Table'[Index]=_above))
var _below=CALCULATE(MIN('Table'[Index]),FILTER(ALL('Table'),'Table'[Index]>SELECTEDVALUE('Table'[Index])))
var _belowve=CALCULATE(MAX('Table'[fecha]),FILTER(ALL('Table'),'Table'[Index]=_below))
return
IF(MAX('Table'[fecha])>=_abovere&&MAX('Table'[fecha])<=_belowve,1,0)
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Thanks for the quick response.
Hi @Syndicate_Admin ,
I have some information to add.
I have create a simple sample, please refer to my post to see if it helps you.
Measure = var _above=CALCULATE(MAX('Table'[Index]),FILTER(ALL('Table'),'Table'[Index]<SELECTEDVALUE('Table'[Index])))
var _abovere=CALCULATE(MAX('Table'[fecha]),FILTER(ALL('Table'),'Table'[Index]=_above))
var _below=CALCULATE(MIN('Table'[Index]),FILTER(ALL('Table'),'Table'[Index]>SELECTEDVALUE('Table'[Index])))
var _belowve=CALCULATE(MAX('Table'[fecha]),FILTER(ALL('Table'),'Table'[Index]=_below))
return
IF(MAX('Table'[fecha])>=_abovere&&MAX('Table'[fecha])<=_belowve,1,0)
How to Get Your Question Answered Quickly - Microsoft Fabric Community
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
here is a similar post - Solved: Previous Row Value Dax - Microsoft Fabric Community
User | Count |
---|---|
98 | |
76 | |
75 | |
49 | |
27 |