MrAnderson
New Member
- Joined
- Mar 6, 2014
- Messages
- 6
Hi,
I’m trying to count the number of instances where a customer has bought 2 particular products in the same invoice. Let’s assume I have the following table called "invoices.
<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
The result I want is the following
<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
I have tried with the CALCULATE function with these formulae:
=calculate(distinctcount(Invoices[InvoiceId],Invoices[ProdId]=1;Invoices[ProdId]=2)
Or
=calculate(distinctcount(Invoices[InvoiceId],Invoices[ProdId]=1&&Invoices[ProdId]=2)
but I get no results, can anyone give a hand?
thanks a lot!.
I’m trying to count the number of instances where a customer has bought 2 particular products in the same invoice. Let’s assume I have the following table called "invoices.
A | B | C | D | E | |
---|---|---|---|---|---|
1 | InvoiceId | InvoiceDate | ProductID | Price | ProductName |
2 | 1 | 01/01/2012 | 1 | 100 | a |
3 | 1 | 01/01/2012 | 2 | 50 | b |
4 | 2 | 02/02/2012 | 1 | 100 | a |
5 | 2 | 02/02/2012 | 4 | 25 | d |
6 | 3 | 03/03/2012 | 1 | 100 | a |
7 | 3 | 03/03/2012 | 2 | 50 | b |
8 | 3 | 03/03/2012 | 5 | 25 | e |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Facturas
The result I want is the following
H | I | |
---|---|---|
2 | Jan | 1 |
3 | Feb | 0 |
4 | March | 1 |
<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Facturas
I have tried with the CALCULATE function with these formulae:
=calculate(distinctcount(Invoices[InvoiceId],Invoices[ProdId]=1;Invoices[ProdId]=2)
Or
=calculate(distinctcount(Invoices[InvoiceId],Invoices[ProdId]=1&&Invoices[ProdId]=2)
but I get no results, can anyone give a hand?
thanks a lot!.