Forum Discussion
Getting days between dates and that consider the first date in column?
Wish to extract a number of days from different columns. I need to create a number of days between 2 different dates, but the last date needs to take into account that it is the first of a type that is in another column.
There are several dates of this type, but I need to link to the first date of this type.
Anyone who can help me with this?
6 Replies
- Syndicate_Admin
Administrator
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - MickeLearnPBI
Helper I
There are several different dates on Reserved, but I only want to take into account the first date (reserved) that I marked in red. So I want to be able to see the number of days from the Date column and what is marked in red.
Do you have any tips how to solve this?
- AnonymousNot applicable
Hi MickeLearnPBI ,
Please new 2 measures:Date 2 = CALCULATE ( MIN ( 'Table'[HousingApplicationEvents.EventStartDate] ), FILTER ( 'Table', 'Table'[HousingApplicationEvents.Personld] = MAX ( 'Table'[HousingApplicationEvents.Personld] ) && 'Table'[HousingApplicationEvents.EventType] = "Reserved" ) )Days = DATEDIFF(MAX('Table'[Date]),[Date 2],DAY)Output:
If that doesn't work, lbendlin's suggestion to post more details would be helpful.
Best Regards,
Gao
Community Support TeamIf 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
- MickeLearnPBI
Helper I
Hi
I got the first date but when i am trying to use it in a table with more than one personalid this only fetch the first number of dates. I would like the first date indivudully for each person, is that possible?
- Syndicate_Admin
Administrator
second request:Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523