Forum Discussion

Zakaria_1980's avatar
Zakaria_1980
Post Patron
3 years ago
Solved

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...
  • Jihwan_Kim's avatar
    3 years ago

    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.

     

    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]
                )
        )