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
PVVBl00
Helper III
Helper III

Join values to single row

Hello everyone                                  

I would like to know if in power BI there is any function or how I should do so that of these 3 columns I only leave the first one with the values of the other 2

PVVBl00_0-1660335854681.png

I need the values in row 2 and 3 to stay in row 1

THANKS¡¡¡

 

1 ACCEPTED SOLUTION
bcdobbs
Community Champion
Community Champion

Try a calculated table:

ADDCOLUMNS (

    SUMMARIZE (
        TableName[NUM ID],

        TableName[Type]
    ),

    "Col1", CALCULATE ( SUM ( TableName[1] ) ),

    "Col2", CALCULATE ( SUM ( TableName[2] )),

    "Col1+2", CALCULATE ( SUM ( TableName[1+2] ))

)

 

Alternatively you could use group by in power query.

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Show clearly the result you are expecting.  Share data in a format that can be pasted in an MS Excel file.


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

Hi @PVVBl00 

first you to have a unique date or index column. If don't you need to create an index column using power query. Then for the 3rd column the code would be

1 + 2 =
VAR CurrentIndex = Date[Index]
VAR CurrentTable =
    CALCULATETABLE ( Data, ALLEXCEPT ( Date, Data[NUM ID], Data[TYPE] ) )
VAR FirstIndex =
    MINX ( CurrentTable, Data[Index] )
VAR TotalValue =
    SUMX ( CurrentTable, Data[1] + Data[2] )
RETURN
    IF ( CurrentIndex = FirstIndex, TotalValue, 0 )
bcdobbs
Community Champion
Community Champion

Try a calculated table:

ADDCOLUMNS (

    SUMMARIZE (
        TableName[NUM ID],

        TableName[Type]
    ),

    "Col1", CALCULATE ( SUM ( TableName[1] ) ),

    "Col2", CALCULATE ( SUM ( TableName[2] )),

    "Col1+2", CALCULATE ( SUM ( TableName[1+2] ))

)

 

Alternatively you could use group by in power query.

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Everything works perfectly for me, thank you very much :)), but in the column of 1 + 2, the value of the sum brings me wrong, you have any idea why it should be?

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Solution Authors
Top Kudoed Authors