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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Zakaria_1980
Post Patron
Post Patron

Need Help please

Hi,

I have such DB for which I need to see Tbl in Power BI, where he will keep me only 1 entry per project taking into account this control:

Check for each project is Start date is the same, should check the end date and keep for me the latest date and delete other rows for that project

if the start date is not the same, he will keep for me the latest date and delete other rows related to that project.

 

I appreciate if you could send me the PBI report so it will be easy for me to understand.

 

 

 

ProjectStart DateEnd date
A21/12/202118/01/2022
B16/10/202217/10/2022
C23/02/202222/04/2022
C23/02/202205/06/2022
C23/02/202225/08/2022
D21/12/201906/07/2022
K09/03/202002/02/2022
F22/06/202103/07/2022
Z15/11/202119/01/2022
Z15/04/202220/06/2022
W08/06/202102/02/2022
J08/04/202018/03/2022
X12/04/202220/04/2022
X29/06/202229/06/2022
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

It is for creating a new table.

 

Jihwan_Kim_0-1675137374915.png

New table = 
VAR _groupbymaxenddate =
    GROUPBY (
        Data,
        Data[Project],
        Data[Start Date],
        "@newenddate", MAXX ( CURRENTGROUP (), Data[End date] )
    )
VAR _maxstartdate =
    GROUPBY (
        _groupbymaxenddate,
        Data[Project],
        "@newstartdate", MAXX ( CURRENTGROUP (), Data[Start Date] )
    )
RETURN
    ADDCOLUMNS (
        _maxstartdate,
        "@enddate",
            MAXX (
                FILTER (
                    _groupbymaxenddate,
                    Data[Project] = EARLIER ( Data[Project] )
                        && Data[Start Date] = EARLIER ( [@newstartdate] )
                ),
                [@newenddate]
            )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

3 REPLIES 3
Zakaria_1980
Post Patron
Post Patron

Yes that's the output i want.

Thanks

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

It is for creating a new table.

 

Jihwan_Kim_0-1675137374915.png

New table = 
VAR _groupbymaxenddate =
    GROUPBY (
        Data,
        Data[Project],
        Data[Start Date],
        "@newenddate", MAXX ( CURRENTGROUP (), Data[End date] )
    )
VAR _maxstartdate =
    GROUPBY (
        _groupbymaxenddate,
        Data[Project],
        "@newstartdate", MAXX ( CURRENTGROUP (), Data[Start Date] )
    )
RETURN
    ADDCOLUMNS (
        _maxstartdate,
        "@enddate",
            MAXX (
                FILTER (
                    _groupbymaxenddate,
                    Data[Project] = EARLIER ( Data[Project] )
                        && Data[Start Date] = EARLIER ( [@newstartdate] )
                ),
                [@newenddate]
            )
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Ashish_Mathur
Super User
Super User

Hi,

Clearly show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors