Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |