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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
EraDon
Frequent Visitor

How summarize, SUMMARIZECOLUMNS or ADDCOLUMNS function sum up a column value on summarize table

Hi,

I'm a little bit confused about how these summarize functions work.

I got this table

EraDon_1-1702379830602.png

I tried to summarize the table with comm_desc and get total saleFinaced_amt because SaleFinaced_amt is repeating the value for each record.

 

Finance sale = ADDCOLUMNS(SUMMARIZECOLUMNS(sale_finance_comm[SaleID], sale_finance_comm[SaleFinanced_amt], "FinanceSaleAmt",SUM(sale_finance_comm[SaleFinanced_amt])),"SaleFinanceAmt",CALCULATE(SUM(sale_finance_comm[SaleFinanced_amt])))
EraDon_0-1702379599836.png

As you can see, it always adds up all repeating values. I don't understand why it summing all values rather than only summarized rows.

Could someone explain to me this and how can I achieve this, please?

 

Kind Regards

Era

 
3 REPLIES 3
Fowmy
Super User
Super User

@EraDon 

When you summarize by sale_finance_comm[SaleID] and  sale_finance_comm[SaleFinanced_amt], it found two records and added to gather and you got the total of 49,000. What is your requirement here? 

I did not get why you tried to summarize your table bya value field here. Please let me know what you are trying to achieve.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

EraDon
Frequent Visitor

Hi Fowmy,

Thanks for the reply. Now, I understand how the sum work with summarize.

I tried to write a measure to get salesfinance_amt to show with each comm_amt in a table

my measure is SUMX(ADDCOLUMNS(SUMMARIZECOLUMNS(sale_finance_comm[SaleID]sale_finance_comm[SaleFinanced_amt]),'SaleFinanceAmt',CALCULATE(SUM(sale_finance_co

mm[SaleFinanced_amt])), [SaleFinanceAmt])

 

I can get the correct comm_amt for each column but SaleFinaceAmt gives a total of two rows.

I need the table below

SaleID   Finance Comms  Originate Fee  Sale Finance amount   
269241788.221227.2724500.00

Hope this will explain my requirements to you. Maybe I missed some concepts here.

 

Kind Regards

Era

 

@EraDon 

Please share some sample data in Excel along with the expected results. Do you need a table or a measure or both, plase specify. Attach your file as a link after saving in Google Srive or One Drive.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors