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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors