The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hey All,
Was wondering if anyone could help me with figuring out a measure for calculating new customers. I run Count Rows on the below query when running it on the desktop file. Credit to Alberto Ferrari for this measure.
EVALUATE
(
FILTER (
CALCULATETABLE (
SUMMARIZE (
'Transactions',
'Transactions'[Customer ID],
"First Trans",
CALCULATE (
MIN ( 'Transactions'[Transaction Date] ),
'Transactions'[Amount] > 0
)
),
ALL ( Dates )
),
CONTAINS (
VALUES ( Dates[Date] ),
DimDates[Date], [First Trans]
)
)
)
This works pretty well when calculating against date. The output in DAX Studio seems to give the correct dates for each customer.
I have a Category ID in Transactions table for which product category the customer purchased. Category ID from Trasactions table connects to DimCategory which has "Category Name". I want to see new customers by Category,
Let's say I have a customer who made his first purchase on 1st Jan buying items from both Category 1 and 2. Then he purchased from Category 3 on 3rd Jan.
The count of new customers for Jan should be 1 and both category ID 1 and 2 should have a count of 1 for new customer. (The total new customer need not match the breakdown as long as it makes sense). Category 3 should not be part of the measure as his "First Trans" was 1st Jan
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |