cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Offset column with a date

Hello everybody,

here is my problem :
I'm trying to offset a column so that i can have the time between operations (in powerbi dax)
the thing is that i can do it with numbers but i dont know why i can't do it with text.
Can someone help me do it please ?
Here is a exemple of a table that i have ( the data is not real) with an added offset colum that i want to code via DAX

1 ACCEPTED SOLUTION
Super User

Hi @stsdrillingeng3 possible solution is calculated column as below. Adjust Sheet1 to your table name.

This solution assumes that column ID is unique value to identify row for end date.

Offset formula =
VAR __current_id=Sheet1[id]
RETURN
CALCULATE(
MAX(Sheet1[end_date]),
FILTER(Sheet1,
Sheet1[id]=__current_id-1)
)

Output

Did I answer correctly? Kudos appreciate / accept solution.

Proud to be a Super User!

2 REPLIES 2
Super User

Hi @stsdrillingeng3 possible solution is calculated column as below. Adjust Sheet1 to your table name.

This solution assumes that column ID is unique value to identify row for end date.

Offset formula =
VAR __current_id=Sheet1[id]
RETURN
CALCULATE(
MAX(Sheet1[end_date]),
FILTER(Sheet1,
Sheet1[id]=__current_id-1)
)

Output

Did I answer correctly? Kudos appreciate / accept solution.

Proud to be a Super User!

Frequent Visitor

Yeas it works perfectly thanks a lot ! I tried using the offset formula but yours is so much more easier and comprehensible.

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors