Is the a way to always ignore a count of records based on specific criteria

MaryF

New Member
Joined
Oct 23, 2013
Messages
2
I am a bit of a newbie when it comes to Powerpivot and a total novice when it comes to forums but have come across an issue I cannot solve on my own and need help.

I have a transaction table, which includes the date the transactions was created and the date it is effective from, along with additional relevant info. The data is coming from a CSV file of which I have no control.

In my data there can be occasions when you summarize the data, that the true count of the transaction is 0 because the total sum of the transaction amount is 0. There could be two or more relevant transactions that cause this to apply. E.g.

0


In this example I really don't want any of these transactions to be included in any count, as collectively they negate each other. This is based on the shared characteristics of CustomerID, ProductID, Effective Date, Transaction Type. Hence the UniqueID calculated column. There are 2 true transactions but as both sum to 0 I really need these to be ignored no matter how they are viewed. I have yet to find a way to achieve this especially if the data is being viewed by the month it was created, as in both instances they both show up i.e. one for September and one for October. Also same applies when viewed by Created by.

Can anyone assist as I just can't figure it out. Here's hoping my question makes sense, please let me know if you need more info or further clarification.

Many thanks in advance.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Re: Is the a way to always ignore a count of records based on specific criteria - UPDATE

I managed to solve this in a way that works, there are probably better solutions which I would love to hear about, but wanted to share in case it is of value to others.

Not sure what happened to my original screenshot, so here is a similar version of the data:

[TABLE="width: 1142"]
<tbody>[TR]
[TD]CustomerID[/TD]
[TD]ProductID[/TD]
[TD]Transaction Ref[/TD]
[TD]Create Date[/TD]
[TD]Effective Date[/TD]
[TD]Transaction Type[/TD]
[TD]ULR[/TD]
[TD]Transaction Amount[/TD]
[TD]Rank[/TD]
[TD]Sum of All Matching Transactions[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]252191[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]1140940ADDP[/TD]
[TD]601.39[/TD]
[TD]1[/TD]
[TD]£601.39[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]259561[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]2140940ADDP[/TD]
[TD]45.24[/TD]
[TD]1[/TD]
[TD]£45.24[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD]325472[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]3240940ADDP[/TD]
[TD]130.65[/TD]
[TD]1[/TD]
[TD]£339.65[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD]325472[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]3240940ADDP[/TD]
[TD]209[/TD]
[TD]2[/TD]
[TD]£339.65[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]2[/TD]
[TD]382542[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]4240940ADDP[/TD]
[TD]66.46[/TD]
[TD]1[/TD]
[TD]£66.46[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]1[/TD]
[TD]384171[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]5140940ADDP[/TD]
[TD]283.63[/TD]
[TD]1[/TD]
[TD]£283.63[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]3[/TD]
[TD]401323[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]6340940ADDP[/TD]
[TD]10.6[/TD]
[TD]1[/TD]
[TD]£0.00[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]3[/TD]
[TD]401323[/TD]
[TD]17/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]6340940ADDP[/TD]
[TD]-10.6[/TD]
[TD]2[/TD]
[TD]£0.00[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]2[/TD]
[TD]405422[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]7240940ADDP[/TD]
[TD]23.96[/TD]
[TD]1[/TD]
[TD]£23.96[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]5[/TD]
[TD]415775[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]8540940ADDP[/TD]
[TD]11.33[/TD]
[TD]1[/TD]
[TD]£11.33[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]3[/TD]
[TD]444763[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]9340940ADDP[/TD]
[TD]30.98[/TD]
[TD]1[/TD]
[TD]£0.00[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]3[/TD]
[TD]444763[/TD]
[TD]12/03/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]9340940ADDP[/TD]
[TD]-30.98[/TD]
[TD]2[/TD]
[TD]£0.00[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]1[/TD]
[TD]460391[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]10140940ADDP[/TD]
[TD]444.57[/TD]
[TD]1[/TD]
[TD]£444.57[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]1[/TD]
[TD]472121[/TD]
[TD]01/02/2012[/TD]
[TD]01/02/2012[/TD]
[TD]ADDP[/TD]
[TD]11140940ADDP[/TD]
[TD]15.97[/TD]
[TD]1[/TD]
[TD]£15.97[/TD]
[/TR]
</tbody>[/TABLE]


The cases in bold are the key examples
The columns Rank & Sum of All Matching Transactions are new calculated columns that I added to get the result I needed

Rank was created using the following formula:

=COUNTROWS( FILTER(
'All Transactions',
'All Transactions'[ULR]
=EARLIER('All Transactions'[ULR]
) && 'All Transactions'[TRANSACTION REF]
<=
EARLIER('All Transactions'[TRANSACTION REF]
) ) )



Sum of All Matching Transactions used:

=CALCULATE(SUM('All Transactions'[Transaction Amount]
),ALLEXCEPT('All Transactions','All Transactions'[ULR]
))

This allowed me to add a measure that considers both these fields to get me what I need, which ultimately was only count one instance of multiple transactions while completely discounting those that sum to zero.

Namely: =CALCULATE(COUNTROWS('All Transactions'),'All Transactions'[Rank]=1,'All Transactions'[Sum of All Matching Transactions]<>0)
 
Upvote 0

Forum statistics

Threads
1,223,967
Messages
6,175,673
Members
452,666
Latest member
AllexDee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top