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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

SUM different row

Hi,

I'm a beginner in Power BI and I have (I think?) a simple question:

 

I have currently this table (Total is a calculated column)

 

Col1ValueTotal
A1100 
A2200 
B1300 
B2400 
A.Total  
B.Total  

 

And I need to calculate the Total column as follow:

 

A.Total = Value[A1] + Value[A2] 

B.Total = Value[B1] + Value[B2]

 

final result:

 

Col1ValueTotal
A1100 
A2200 
B1300 
B2400 
A.Total 300
B.Total 700

 

Im not sure if I should use a measure or a calculated column for this calculation, for now: I'm trying with a Custom Column, Can you please advise if this script is correct ?

 

 

Calculte(SUM(["A1"]+["A2"]),FILTER(["Total"]="A.Total"))

and 

Calculte(SUM(["B1"]+["B2"]),FILTER(["Total"]="B.Total"))

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

Sorry for the late reply, I was in vacation.

 

I'm not sure if this is the right method by the admin to mark a reply as solved, that's definetly NOT the solution that I was looking for. Having admin rights doesn't mean you can do whatever you want...

 

The right way that I did is:

1) Pivot those rows into columns in Power BI Queries with language M.

2) Create a calculated column to sum up the new pivoted columns.

3) Unpivot those columns into rows.

 

This wroked great !

View solution in original post

11 REPLIES 11

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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