Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |