Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin 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
Hi there, I am trying to make a calculated column that simply pulls a value from another column if the preceeding row has a certain value. in a different column. I have an index column named "Row #" with row number as shown below that the EARLIER function can be based on. I dont want it sorted by anything othger than the previous action being a cell. I have provided a screenshot of what I hope to accomplish. Any help is appreciated, thanks!
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I tried to use OFFSET DAX function in the calculated column formula.
OFFSET function (DAX) - DAX | Microsoft Learn
value(price) calculated column =
VAR _nextrow =
MAXX (
OFFSET ( 1, SUMMARIZE ( data, data[row#] ), ORDERBY ( data[row#], ASC ) ),
data[row#]
)
VAR _nextaction =
MAXX ( FILTER ( data, data[row#] = _nextrow ), data[action] )
VAR _condition = _nextaction = "sell"
&& data[action] = "buy"
RETURN
IF ( _condition, data[price] )
Can you explain a little deeper what you want to accomplish and in which situation?
Hi @LoganFFS,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @Jihwan_Kim for the prompt response.
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the user resolved your issue? or let us know if you need any further assistance.
If any response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
Hi @LoganFFS,
We wanted to kindly follow up to check if the solution provided by the user resolved your issue.
If any response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
Hi @LoganFFS,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided by the user resolved your issue.
If any response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
I tried to use OFFSET DAX function in the calculated column formula.
OFFSET function (DAX) - DAX | Microsoft Learn
value(price) calculated column =
VAR _nextrow =
MAXX (
OFFSET ( 1, SUMMARIZE ( data, data[row#] ), ORDERBY ( data[row#], ASC ) ),
data[row#]
)
VAR _nextaction =
MAXX ( FILTER ( data, data[row#] = _nextrow ), data[action] )
VAR _condition = _nextaction = "sell"
&& data[action] = "buy"
RETURN
IF ( _condition, data[price] )
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 7 | |
| 5 |