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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
bejenaru_a
Frequent Visitor

SUMMARIZE by latest ID based on onether ID

Hi Everyone, 

I have a table which contains projects and for each project I have different versions. 

I would like to have a summarized table for the latest Version ID.

bejenaru_a_0-1657701872738.png

 

 

_MeasureTableCockpitByProject = SUMMARIZE(E0101_Cockpit,E0101_Cockpit[Obj_ID],E0101_Cockpit[Version_ID]
    ,"ByProjectEXKL", SUM(E0101_Cockpit[MF1_GEW_RLMV])
    ,"ByProjectMF2-A", SUM(E0101_Cockpit[UmlageA])
    ,"ByProjectMF2-B", SUM(E0101_Cockpit[UmlageB])
    ,"ByProjectMF2-C", SUM(E0101_Cockpit[UmlageC])
    ,"ByProjectMF2-D", SUM(E0101_Cockpit[UmlageD])
    ,"ByProjectMF2-E", SUM(E0101_Cockpit[UmlageE])
    ,"ByProjectMF2-F", SUM(E0101_Cockpit[UmlageF])
    ,"ByProjectMF2-G", SUM(E0101_Cockpit[UmlageG])
    ,"ByProjectMF2-H", SUM(E0101_Cockpit[UmlageH])
    ,"ByProjectMF2-J", SUM(E0101_Cockpit[UmlageJ])
    ,"ByProjectGEM", SUM(E0101_Cockpit[SuUmlage])
    ,"ByProjectMF", SUM(E0101_Cockpit[MF])
    ,"ByProjectInk. MBF", SUM(E0101_Cockpit[MBF])
    ,"ByProjectZzgl. SoMo", SUM(E0101_Cockpit[SMO])
    ,"ByProjectSt.pl.", SUM(E0101_Cockpit[AnzahlParken])
    )

 

 

The table should not show these 2 lines:

bejenaru_a_1-1657701910862.png

 

Can anyone help?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @bejenaru_a ,

 

You can create a new table with dax

Origin table :

vbinbinyumsft_0-1657872053079.png

 


New table :

DAX:

Table 2 =
SELECTCOLUMNS (
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[Obj_ID],
            "Versions_ID", MAX ( 'Table'[Versions_ID] )
        ),
        "ByPrjoject-A",
            CALCULATE (
                MAX ( 'Table'[ByProject-A] ),
                'Table'[Versions_ID] = EARLIER ( [Versions_ID] )
            ),
        "ByPrjoject-B",
            CALCULATE (
                MAX ( 'Table'[ByProject-B] ),
                'Table'[Versions_ID] = EARLIER ( [Versions_ID] )
            ),
        "ByPrjoject-C",
            CALCULATE (
                MAX ( 'Table'[ByProject-C] ),
                'Table'[Versions_ID] = EARLIER ( [Versions_ID] )
            ),
        "ByPrjoject-D",
            CALCULATE (
                MAX ( 'Table'[ByProject_D] ),
                'Table'[Versions_ID] = EARLIER ( [Versions_ID] )
            )
    ),
    "Versions_ID", [Versions_ID],
    "Obj_ID", [Obj_ID],
    "ByProject-A", [ByPrjoject-A],
    "ByProject-B", [ByPrjoject-B],
    "ByProject-C", [ByPrjoject-C],
    "ByProject-D", [ByPrjoject-D]
)

vbinbinyumsft_0-1657877294160.png

 

 

If I misunderstand your demands, please feel free to let me know.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @bejenaru_a ,

 

You can create a new table with dax

Origin table :

vbinbinyumsft_0-1657872053079.png

 


New table :

DAX:

Table 2 =
SELECTCOLUMNS (
    ADDCOLUMNS (
        SUMMARIZE (
            'Table',
            'Table'[Obj_ID],
            "Versions_ID", MAX ( 'Table'[Versions_ID] )
        ),
        "ByPrjoject-A",
            CALCULATE (
                MAX ( 'Table'[ByProject-A] ),
                'Table'[Versions_ID] = EARLIER ( [Versions_ID] )
            ),
        "ByPrjoject-B",
            CALCULATE (
                MAX ( 'Table'[ByProject-B] ),
                'Table'[Versions_ID] = EARLIER ( [Versions_ID] )
            ),
        "ByPrjoject-C",
            CALCULATE (
                MAX ( 'Table'[ByProject-C] ),
                'Table'[Versions_ID] = EARLIER ( [Versions_ID] )
            ),
        "ByPrjoject-D",
            CALCULATE (
                MAX ( 'Table'[ByProject_D] ),
                'Table'[Versions_ID] = EARLIER ( [Versions_ID] )
            )
    ),
    "Versions_ID", [Versions_ID],
    "Obj_ID", [Obj_ID],
    "ByProject-A", [ByPrjoject-A],
    "ByProject-B", [ByPrjoject-B],
    "ByProject-C", [ByPrjoject-C],
    "ByProject-D", [ByPrjoject-D]
)

vbinbinyumsft_0-1657877294160.png

 

 

If I misunderstand your demands, please feel free to let me know.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

johnt75
Super User
Super User

You could try

Summary Table =
var filterTable = ADDCOLUMNS( VALUES('Table'[Object ID]), "@version", CALCULATE(MAX('Table'[Version ID])))
return CALCULATETABLE( SUMMARIZE( 'Table', all your column definitions),
filterTable)

Thank you for the suggestion but it does not give me the result i wang

I have done the following: 

1. Create a table which gives me the Obj_ID and latest Version_ID 

bejenaru_a_0-1657788113689.png

2.Create the table which summarizes all the Obj_ID and the Version_ID data. (This is the table i had in my initial question)

bejenaru_a_1-1657788228838.png

3.Create a third table which is the result on NATURALINNERJOIN of table 1 and 2.

bejenaru_a_2-1657788304109.png

It is not an elegant solution but this is how much I know about PowerBI 😞

I did find myself with the issue of mismatch types this is why there is a +0 after Version_ID

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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