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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
heathernicole
Continued Contributor
Continued Contributor

Why is SUM() doubling value in column - but ONLY in some fields?

Object: to create a Incoming Total Sales Measure - 

 

Incoming Total Sales = CALCULATE(SUM('SALES DETAILS'[SalesTxn Document Total Amount]), FILTER('SALES DETAILS', 'SALES DETAILS'[SalesTxn Document Type] = "Sales Order"))

 

 

When I filter the reference number on the dataset- the Measure is correct - (sorry for the first image - I realized I uploaded the wrong photo. Sorry if it caused any confusion! I'll upload the correct filtered image when I get back to that particular computer).

 

 

However, when I remove a filter - it doubles (or more) the value in the Measure for some reason:

Dataset2.PNG

 

But not on every row. Just on some. I can't find a particular pattern. Because of this - it skews the total amount as well, nearly doubling the value. 

 

Any assistance would be greatly appreciated. I'm not sure why it's behaving this way. 

~heathernicoale
1 ACCEPTED SOLUTION

I figured out what was wrong.... 🙂 Oddly enough the Document Total column from the database was WRONG - my dax measure was closer than I thought.

 

I did however, need to add the Tax field to get the exact amount for each Sales Order:

 

Correct Measure is here:

Dollars w/ Tax = SUM('SALES DETAILS'[SalesTxn Document Sales Tax Amount]) + SUM('SALES DETAILS'[SalesTxn Line Sales Order Original Amount])

And then to configure Incoming Sales:

Incoming Total Sales = CALCULATE([Dollars w/ Tax], 'SALES DETAILS'[SalesTxn Document Type] = "Sales Order")

So it took two steps to create an 'Incoming Total Sales' measure using QuickBooks data. 

 

Thanks @v-caliao-msft for attempting to help me! And you were right on the duplicates - QuickBooks generates multiple rows for the same order depending on the tasks being applied. 

 

 

~heathernicoale

View solution in original post

3 REPLIES 3
heathernicole
Continued Contributor
Continued Contributor

@v-caliao-msft

 

Incoming Total Sales                    SalesTxn Document Total Amount                         Sales Document Reference Number
$396.00                                                         396                                                               20581
$352.00                                                         352                                                               20582
$360.00                                                         384.3                                                            20583
$228.00                                                         228                                                               20584
$50.00                                                           50                                                                 20585
$1,960.00                                                      1960                                                             20586
$348.00                                                         348                                                               20587
$400.00                                                         428                                                               20588
$520.00                                                         520                                                               2 0589
$198.50                                                        198.5                                                             20590
$215.00                                                        215                                                                20591
$175.00                                                        175                                                                20592
$617.00                                                        1234                                                              20593
$375.00                                                        1125                                                              20594
$376.00                                                        376                                                                20595
$1,493.72                                                     5974.88                                                          20596
$200.25                                                        400.5                                                             20597
$1,498.60                                                     5994.4                                                           20598
$172.00                                                        172                                                                20599
$1,085.00                                                     2170                                                              20660
$975.00                                                       1950                                                              20661
$3,525.00                                                     7050                                                             20668

~heathernicoale

I figured out what was wrong.... 🙂 Oddly enough the Document Total column from the database was WRONG - my dax measure was closer than I thought.

 

I did however, need to add the Tax field to get the exact amount for each Sales Order:

 

Correct Measure is here:

Dollars w/ Tax = SUM('SALES DETAILS'[SalesTxn Document Sales Tax Amount]) + SUM('SALES DETAILS'[SalesTxn Line Sales Order Original Amount])

And then to configure Incoming Sales:

Incoming Total Sales = CALCULATE([Dollars w/ Tax], 'SALES DETAILS'[SalesTxn Document Type] = "Sales Order")

So it took two steps to create an 'Incoming Total Sales' measure using QuickBooks data. 

 

Thanks @v-caliao-msft for attempting to help me! And you were right on the duplicates - QuickBooks generates multiple rows for the same order depending on the tasks being applied. 

 

 

~heathernicoale
v-caliao-msft
Employee
Employee

@heathernicole,

 

Could you please share some sample data? It seems that there are multiple records for the sameReference Number in your dataset. So that when you remove the filter, the measure value doubles.

 

Regards,

Charlie Liao

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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