cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TimoRatz Member
Member

Sum of a column with text filters

Hi,

 

I have got a table like this

LandGroupTypeValue
ChinaAXY10
GermanyAZU21
USABXY15
SpainBZU16
ChinaCXY8
USACXY25
ChinaAXY20
GermanyAZU15
USABXY3
SpainBXY15
ChinaCXY8
USACXY20

 

Now I want to calculate the Sum the column Value which is grouped by Land, Group and type (for example). To get this:

LandGroupTypeSum Value
ChinaAXY30
ChinaCXY16
GermanyAZU36
SpainBZU16
SpainBXY15
USABXY18
USACXY45

 

Any Ideas?

 

Best regards

Timo

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Sum of a column with text filters

@TimoRatz  Please try this as a "New Table"

 

GroupingTestOut = SUMMARIZECOLUMNS(GroupingTest[Land],GroupingTest[Group],GroupingTest[Type],"Total Value",SUM(GroupingTest[Value]))

image.png



Did I answer your question? Mark my post as a solution !

Proud to be a Datanaut !





View solution in original post

5 REPLIES 5
George1 Regular Visitor
Regular Visitor

Re: Sum of a column with text filters

Hi,

Depending on what you want to achieve, this can be done with a simple matrix. 

Add Land, Group, Type in Rows

Add Value in Values

 

Drill down and format as required.

TimoRatz Member
Member

Re: Sum of a column with text filters

Hi @George1 ,

 

thanks for your reply.

But I need it as a calculated column. I have to calculate some other values with this column.

 

BR

Timo

Highlighted
Super User
Super User

Re: Sum of a column with text filters

@TimoRatz  Please try this as a "New Table"

 

GroupingTestOut = SUMMARIZECOLUMNS(GroupingTest[Land],GroupingTest[Group],GroupingTest[Type],"Total Value",SUM(GroupingTest[Value]))

image.png



Did I answer your question? Mark my post as a solution !

Proud to be a Datanaut !





View solution in original post

Community Support Team
Community Support Team

Re: Sum of a column with text filters

Hi @TimoRatz ,

 

You can create a calculated column like DAX below.

 

Sum Value = CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),'Table'[Land]=EARLIER('Table'[Land])&&'Table'[Group]=EARLIER('Table'[Group])&&'Table'[Type]=EARLIER('Table'[Type])))

38.png

 

 

 

 

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

George1 Regular Visitor
Regular Visitor

Re: Sum of a column with text filters

Try this:

 

CalcTable =
SUMMARIZECOLUMNS (
    Table1[Land],
    Table1[Group],
    Table1[Type],
    "Sum Value", SUM ( Table1[Value] )
)

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 64 members 1,359 guests
Please welcome our newest community members: