Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
MickeLearnPBI
Helper I
Helper I

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 6
Syndicate_Admin
Administrator
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-...
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/1447...

MickeLearnPBI
Helper I
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?

Skärmbild 2023-11-18 170354.png

Anonymous
Not 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:

vcgaomsft_0-1700463872640.png

If that doesn't work, lbendlin's suggestion to post more details would be helpful.

Best Regards,
Gao

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

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?

Anonymous
Not applicable

Hi @MickeLearnPBI ,

What is your expected output? Could you please simulate it in Excel and take a screenshot?

vcgaomsft_0-1700616143088.png

vcgaomsft_1-1700616160041.png

Best Regards,
Gao

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 -- China Power BI User Group

Syndicate_Admin
Administrator
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-...
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/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.