Forum Discussion
Incorrect Measure Total
Hi,
I am getting the incorrect total for my measure '% Turnover Value'. The total is showing 135,656, but I expect a figure of 69,089.
I am presuming the Accounts with no 'Average of % Turnover' are effecting the outcome but not sure of how to fix this.
I know the total for 'Sales Value Final £/€' is also incorrect but I presume its the same issue.
Results'% Turnover Value' Measure
Can anybody help please?
Hi,
The SUMX() portion of the formula should be something like this
=SUMX(SUMMARIZE(VALUES(Rebates[Account/Group]),[Account/Group],"ABCD",SUM(Sales value final)*AVERAGE(Rebates[% turnover])),[ABCD])
Include the curency symbol in the underlines portion.
If this formula does not help, then share the link from where i can download your PBI file.
23 Replies
- Ashish_MathurSuper User
Hi,
The SUMX() portion of the formula should be something like this
=SUMX(SUMMARIZE(VALUES(Rebates[Account/Group]),[Account/Group],"ABCD",SUM(Sales value final)*AVERAGE(Rebates[% turnover])),[ABCD])
Include the curency symbol in the underlines portion.
If this formula does not help, then share the link from where i can download your PBI file.
- jcarvilleSkilled Sharer
Ashish_Mathur, amazing! That's the exact solution that I have been looking for, thank you for your help.
- Ashish_MathurSuper User
You are welcome.
- AnonymousNot applicable
I'm having a similar struggle where within my datagrid individuals rows are calculating but the total line is wrong.
Stuck thoughts?
Here is my Dax expression:
MTD_PY_Variance_Matrix =
(
CALCULATE (
KPI_Finance_Matrix[MTD_Actuals_Matrix] - KPI_Finance_Matrix[MTD_PY_Actuals],
KPI_Finance_Matrix[Group] = "Revenue"
)
)
+ (
CALCULATE (
KPI_Finance_Matrix[MTD_Actuals_Matrix] - KPI_Finance_Matrix[MTD_PY_Actuals],
KPI_Finance_Matrix[Group] = "Gross Margin"
)
)
+ (
CALCULATE (
KPI_Finance_Matrix[MTD_PY_Actuals] - KPI_Finance_Matrix[MTD_Actuals_Matrix],
KPI_Finance_Matrix[Group] = "Operating Expenses"
)
) - AnonymousNot applicable
Im at a breaking point, tried all the suggestions from many articles but still struggling with fixing totals.
1. created a measure to return sales last year using the below
VAR = CALCULATE(SUMX(Sales,Sales[revenue local currency]),DATEADD('Calendar'[Date],-1,YEAR))2. Created another measure to return fx rate from the sames for the selected year and month on the slicerVAR B =MIN(Sales[rate])3. convert the local currency revenue to USDDIVIDE(A,B,0)
Calculation works, but the total is incorrect. I used the below DAX in one measure,REV_USD_LY = VAR A = CALCULATE(SUMX(Sales,Sales[revenue local currency]),DATEADD('Calendar'[Date],-1,YEAR)) VAR B = CALCULATE(MIN(Sales[rate]),ALL('Calendar')) VAR div = DIVIDE(A,B,0)If you see the total, it returns sames as revenue local currency last year, can you please help?
- jcarvilleSkilled Sharer
I have been using this guide as a potential solution, which has worked previously for myself, but I still cannot get the solution I need: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
- AnonymousNot applicable
Hi,
I am expecting for the "Total" to display the sum of the values in the column. Can anyone help me with this please?
Formula is,
Zero availability =
var A = SUMX (
agg_bb_sku_oos_daily,
CALCULATE (
DISTINCTCOUNT ( agg_bb_sku_oos_daily[source_sku_id] ),
agg_bb_sku_oos_daily[oos_in_hours_range] = "Zero Availability"
))
var B = CALCULATE(DISTINCTCOUNT(agg_bb_sku_oos_daily[sku_oos_date]),GROUPBY(agg_bb_sku_oos_daily,agg_bb_sku_oos_daily[source_sku_id]),agg_bb_sku_oos_daily[sku_oos_date])
return
A/Bsource_sku_id sku_oos_date oos_in_hours_range Volume Zero Availability Var1 Var2 SKU1 1/8/2019 Zero Availability 100.00 1 1 1 SKU2 1/8/2019 test 1309.00 0 6 SKU2 1/9/2019 Zero Availability 138.00 0.166666667 1 6 SKU2 1/10/2019 Zero Availability 20941.00 0.166666667 1 6 SKU2 1/11/2019 Zero Availability 214.00 0.166666667 1 6 SKU2 1/12/2019 Zero Availability 234.00 0.166666667 1 6 SKU2 1/13/2019 Zero Availability 294.00 0.166666667 1 6 Total 1 6 6 - Ashish_MathurSuper User
Hi,
Please explain the business question and show the expected result.
- AnonymousNot applicable
Hi Ashish,
We have a measure "Zero Availability" which gets calculate using logic (table data provided in above comments), This returns row-wise correct values but at the total we would expect to see summation of row values. As shown in previous comments DAX will do again calculation (row context) and returning result as "1" but what we expect is "1.8333" which is row values SUM.
Var 1 = SUMX ( agg_bb_sku_oos_daily, CALCULATE ( DISTINCTCOUNT ( agg_bb_sku_oos_daily[source_sku_id] ), agg_bb_sku_oos_daily[oos_in_hours_range] = "Zero Availability" ) ),Var 2 = CALCULATE ( DISTINCTCOUNT ( agg_bb_sku_oos_daily[sku_oos_date] ), GROUPBY ( agg_bb_sku_oos_daily, agg_bb_sku_oos_daily[source_sku_id] ), agg_bb_sku_oos_daily[sku_oos_date] ))Zero Availability = Var 1/ Var 2I have used below formula to get the correct results at the "Total" but, Performance is degraded as it is iterating for each rows. Is there any alternative approach which doesn't impact performance as well?RowValues = DIVIDE (SUMX ( agg_bb_sku_oos_daily, CALCULATE ( DISTINCTCOUNT ( agg_bb_sku_oos_daily[source_sku_id] ), agg_bb_sku_oos_daily[oos_in_hours_range] = "Zero Availability" ) ),, CALCULATE ( DISTINCTCOUNT ( agg_bb_sku_oos_daily[sku_oos_date] ), GROUPBY ( agg_bb_sku_oos_daily, agg_bb_sku_oos_daily[source_sku_id] ), agg_bb_sku_oos_daily[sku_oos_date] )))Zero Availability = VAR __table =SUMMARIZE ( 'agg_bb_sku_oos_daily', [source_sku_id], "__value", [RowValues] )RETURN
IF (HASONEVALUE ( agg_bb_sku_oos_daily[source_sku_id] ),[RowValues],SUMX( __table, [__value] ))