Forum Discussion
Abrar786
Helper I
3 years agoIncorrect total for column in matrix
Hello,
I am getting an incorrect total for my measure. Please see below for the details of my measure.
Increase Sale =
VAR customers =
FILTER (
ADDCOLUMNS (
DISTINCT ( invoices_details[customer_no] ),
"@CYSale", [Total Sale],
"@LYSale", [LY Sale],
"@SaleDiff", [Total Sale] - [LY Sale]
),
[@CYSale] > 0
&& [@LYSale] > 0
&& [@CYSale] > [@LYSale]
&& COUNTROWS (
FILTER (
'category',
[@SaleDiff] >= 'category'[category min value]
&& [@SaleDiff] < 'category'[category max value]
)
) > 0
)
RETURN
SUMX ( customers, [@SaleDiff] )
Thank you in advance for the help.
3 Replies
- amitchandak
Super User
Abrar786 , Try two measures like
Inc =COUNTROWS (
FILTER (
'category',
[@SaleDiff] >= 'category'[category min value]
&& [@SaleDiff] < 'category'[category max value]
)
)
Increase Sale =Sumx(FILTER (
ADDCOLUMNS (
values ( invoices_details[customer_no] ),
"@CYSale", [Total Sale],
"@LYSale", [LY Sale],
"@SaleDiff", [Total Sale] - [LY Sale]
),
[@CYSale] > 0
&& [@LYSale] > 0
&& [@CYSale] > [@LYSale]
&& [Inc]> 0
),[@SaleDiff]) - Ahmedx
Super User
write another measure like this
SUMX ( VALUES('table'[category Name]), [Increase Sale] - Ashish_Mathur
Super User
Hi,
Share the download link of the PBI file.