Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi guys,
I have an issue with my formulas in order to calculate the number of transactions each month per customer status.
I have three tables : Customer, Order and Calendar
My order table looks like this
Sales order date | transaction ID | Customer ID | Amount |
01/10/2019 | xxxx | xxxx@gmail.com | 120 |
02/10/2019 | xxxx | xxxx@gmail.com | 121 |
03/10/2019 | xxxx | xxxx@gmail.com | 122 |
04/10/2019 | xxxx | xxxx@gmail.com | 123 |
05/10/2019 | xxxx | xxxx@gmail.com | 124 |
06/10/2019 | xxxx | xxxx@gmail.com | 125 |
07/10/2019 | xxxx | xxxx@gmail.com | 126 |
08/10/2019 | xxxx | xxxx@gmail.com | 127 |
09/10/2019 | xxxx | xxxx@gmail.com | 128 |
i tried some of the formulas in this forum but i still don't get the right number:
Solved! Go to Solution.
Hi @Anonymous
Suppose your tables have relationships like below:
To count the number of transactions per customer, create a measure:
Count of transactions =
VAR customer = SELECTEDVALUE(Customers[Customer ID])
RETURN
CALCULATE(COUNT(Orders[transaction ID ]),FILTER(Orders,Orders[Customer ID] = customer))
Test the result:
My sample data:
Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
Hi,
I cannot understand your requirement. On the sample data, show the exact result that you are expecting.
Hi,
So i would like to have a table to show the number of transaction each month for returning and new customers.
The outcome would look like this :
New customers Transactions
Year | Jan | feb | March | Apr | May |
2020 | 1250 | 1000 | 5200 | 526 | 123 |
New customers can have two or three transactions so the formulas for new and returning customers count doesn't work since it count unique customers each month
This is my formulas now for the tables
Hi,
I just do not understand your question. Someone who does will help you.
Hi @Anonymous
Suppose your tables have relationships like below:
To count the number of transactions per customer, create a measure:
Count of transactions =
VAR customer = SELECTEDVALUE(Customers[Customer ID])
RETURN
CALCULATE(COUNT(Orders[transaction ID ]),FILTER(Orders,Orders[Customer ID] = customer))
Test the result:
My sample data:
Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |