Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
To a table a copy of the initial record is added when there was a change.
I would like to calculate the days between these changes so that I know how many days passed between the different kinds of status.
Record ID | Product | Status | Record created | Date of last change |
|
1 | Trouser | Ordered | 2023-10-11 | 2023-10-11 |
|
1 | Trouser | Shipped | 2023-10-11 | 2023-10-12 |
|
1 | Trouser | Delivered | 2023-10-11 | 2023-10-23 |
|
This means I should be able to display results like:
Days between Status “Ordered” and “Shipped” = 1 day
Days between Status “Shipped” and “Delivered” = 12 days
Days between Status "Shipped” and “Delivered" = 11 days
How to do this in Power BI?
Solved! Go to Solution.
Hi HILGARTH,
May I ask if this is the expected output you are looking for? Based on your description, I calculated days between Status “Ordered” and “Shipped” and “Shipped” and “Delivered”, The following table shows the effect of the display.
Step: Create a new Calculated column, and drag the new Calculated column to the table visual.
Column =
DATEDIFF (
CALCULATE (
MAX ( 'Table'[Date of last change] ),
FILTER (
ALL ( 'Table' ),
EARLIER ( 'Table'[Date of last change] ) > 'Table'[Date of last change]
&& 'Table'[Record ID] = EARLIER ( 'Table'[Record ID] )
)
),
'Table'[Date of last change],
DAY
)
If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi HILGARTH,
May I ask if this is the expected output you are looking for? Based on your description, I calculated days between Status “Ordered” and “Shipped” and “Shipped” and “Delivered”, The following table shows the effect of the display.
Step: Create a new Calculated column, and drag the new Calculated column to the table visual.
Column =
DATEDIFF (
CALCULATE (
MAX ( 'Table'[Date of last change] ),
FILTER (
ALL ( 'Table' ),
EARLIER ( 'Table'[Date of last change] ) > 'Table'[Date of last change]
&& 'Table'[Record ID] = EARLIER ( 'Table'[Record ID] )
)
),
'Table'[Date of last change],
DAY
)
If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Dear Yang
Great - that works!
thx & best regards
=VAR _d=MAX(Table[Date of last change]) RETURN _d+1-COALESCE(CACULATE(MAX(Table[Date of last change]),Table[Date of last change]<_d,ALLEXCEPT(Table,Table[Record ID]),MAX(Table[Record Created]))
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |