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

How to sum up few rows based on another column

Hi,

 

I want to sum up the not covered & covered column based on their region in power BI

Jack11_0-1599145356154.png

 

8 REPLIES 8
negi007
Community Champion
Community Champion

@Anonymous  You can use below expression 

 

Total_Cov_NonCov= SUMX(TableName,TableName[Column1]+TableName[Column2])

 

Total_Cov_NonCov= SUMX(Covered,Covered[Covered]+Covered[Not covered])
 
 
negi007_0-1599146887670.png

 




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



Proud to be a Super User!


Follow me on linkedin

amitchandak
Super User
Super User

@Anonymous , Try one of the two

Total = SUM (Table[Covered]) + SUM(Table[Not Covered])

Total = SUMX(Table,[Covered]+ [Not Covered])

annaselway
Frequent Visitor

Hi @Anonymous, 

 

From your message are you looking to add together th values of not covered + covered per reion, or sum not covered total for one region and covered total for one region? 

If the latter you want to create a measure to sum the values, you'd create one for not covered and one for covered. 

 

TotalNotCovered = var region= [Region]
RETURN
CALCULATE(
	SUM('YourTable'[NotCovered])
	ALL('YourTable'),
	'YourTable'[Region] = region
)

 

Anonymous
Not applicable

Hi @annaselway

I want to sum up covered based on region & same for uncovered, but am getting this warning message, can you please help me

Jack11_0-1599153678426.png

Hi , @Anonymous 

The screenshot is not clear enough to  recognize the error message .

If possible,could you share  a sample pbix for testing?

Does @annaselway ‘s  formula  work?

 

TotalNotCovered =
VAR region =
    MAX ( 'Table'[Region] )
RETURN
    CALCULATE (
        SUM ( 'Table'[NotCovered] ),
        ALL ( 'Table' ),
        'Table'[Region] = region
    )

 


Best Regards,
Community Support Team _ Eason

@Anonymous  Hi Jack. I do not think you need to create a measure in this case. You just need to put the region in the slicer or column if you are using matrix visual and then put covered and uncovered in value. See below screenshot for help

 

negi007_0-1599194309963.png

 




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



Proud to be a Super User!


Follow me on linkedin

Anonymous
Not applicable

@negi007 , i want to use the sum value in a different chart, thats the reason am trying to create a measure

jdbuchanan71
Super User
Super User

@Anonymous 

This measure will add the two amounts together. 

Total = SUM ( YourTable[Covered] ) + SUM ( YourTable[Not Covered] )

Then you put the region and that measure in a table to show your value. 

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.