cancel
Showing results for
Did you mean:
Helper III

## SUMX TOTALS DO NOT MAKE SENSE

Hi guys,

I wanted to do a basic calculation using sumx to model the changes to total sales when discounts are modified based on a criteria but I can see that my total is largely over than expected.  The measure is listed below.

Measure 3 =
var __cust = FILTER( ALLSELECTED(SALES[PI]), [AVERAGE SPEND] > 0 )
return
SUMX(
FILTER(
VALUES(SALES[PI]),
[AVERAGE SPEND]>0
),
IF(HASONEFILTER(CUSTOMERS[CNAME]),([LIST PRICE]*(1-[PROPOSED DISCOUNT]))*[AVERAGE QUANTITY SOLD],SUMX(VALUES(CUSTOMERS[CNAME]),([LIST PRICE]*(1-[PROPOSED DISCOUNT]))*[AVERAGE QUANTITY SOLD])))

Essentially, I calculate each customers spend across all their skus where there is a sale, and model the new sales amount based on the new discount i set.  it works individually but not when I calcualte these proposed changes for all the customers as shown below

Any help would be appreciated !

2 REPLIES 2
Super User

Your measure is pretty difficult to understand but I'm guessing you can simplify it into something more like this:

``````SUMX (
VALUES ( CUSTOMERS[CNAME] ),
SUMX (
CALCULATETABLE ( VALUES ( SALES[PI] ), [AVERAGE SPEND] > 0 ),
[LIST PRICE] * ( 1 - [PROPOSED DISCOUNT] ) * [AVERAGE QUANTITY SOLD]
)
)``````

I'm making quite a few assumptions here, so I don't necessarily expect this to work but it might be a place to start from.

Helper III

Hi there,

Thanks for your help.  It didnt work.

Essentially, I just want the total to be the correct sum of each individual account above for measure 3.  The measure is being calculated correctly but the total is way over than what is expected

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

#### Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors