cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Midguel
Helper I
Helper I

Concatenate SUM of values

Hi! I asked this in respond of other post but i think is worth to create a new one, I'm trying to reach a new calculated column like the last one of the image:

concat.PNG

I'm trying to create a list for every "OP" with the concatenate of "EE" and in parenthesis the sum of "tns" whenever the OP, EE and the Date are the same, the tricky part it's that in my source I have other columns like "lingado" that makes my table more repetitive.

With this I'm trying to reach a visual like this one:

concat2.PNG

Please help, any help would very much appreciate, thank you!!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Midguel , Try a measure like

measure =
var _tab = summarize(Table, table[OP], Table[EE], "_1", sum(Table[tns]))
return
concatenatex(_tab, EE & "(" & _1 & ")")

 

Display with OP

 



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

View solution in original post

Hi @Midguel ,

 

Try this as a Calculated COlumn

 

CCEPCol =
VAR summtab =
    CONCATENATEX (
        FILTER (
            SUMMARIZE (
                'Table10',
                Table10[Date],
                Table10[OP],
                Table10[EE],
                "TNS", SUM ( Table10[TNS] )
            ),
            Table10[Date]
                = EARLIER ( Table10[Date] )
                && Table10[OP]
                    = EARLIER ( Table10[OP] )
        ),
        Table10[EE] & "(" & [TNS] & ")",
        ","
    )
RETURN
    summtab

 

1.jpg

 

 

 

Regards,
Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

 

 

View solution in original post

4 REPLIES 4
Midguel
Helper I
Helper I

thanks! @harshnathani @amitchandak , both worked pretty well, i was thinking if there's a way to make this in a calculated column? instead of a measure, because i wanted to take this column in a matrix as a row and i can not reach that with a measure, again thanks for your help.

Hi @Midguel ,

 

Try this as a Calculated COlumn

 

CCEPCol =
VAR summtab =
    CONCATENATEX (
        FILTER (
            SUMMARIZE (
                'Table10',
                Table10[Date],
                Table10[OP],
                Table10[EE],
                "TNS", SUM ( Table10[TNS] )
            ),
            Table10[Date]
                = EARLIER ( Table10[Date] )
                && Table10[OP]
                    = EARLIER ( Table10[OP] )
        ),
        Table10[EE] & "(" & [TNS] & ")",
        ","
    )
RETURN
    summtab

 

1.jpg

 

 

 

Regards,
Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

 

 

harshnathani
Community Champion
Community Champion

Hi @Midguel ,

 

Solution already posted but responding since was working on the solution.

 

You can also try

 

CCEPMeasure = 
var summtab = 
CONCATENATEX(

    SUMMARIZE('Table10',Table10[Date], Table10[EE],"TNS" , SUM(Table10[TNS])),Table10[EE] & "(" & [TNS] & ")",",")

RETURN
summtab

 

 

Regards,

Harsh Nathani

amitchandak
Super User
Super User

@Midguel , Try a measure like

measure =
var _tab = summarize(Table, table[OP], Table[EE], "_1", sum(Table[tns]))
return
concatenatex(_tab, EE & "(" & _1 & ")")

 

Display with OP

 



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors