Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi there,
I wrote a measure to get the customers who purchased a product for the first time in a certain period.
The formula below works but I'm trying to take it to the next level and say 'first time' for the users.
At the moment, 1 is pulling in but I want to change it to say 'First Time'. Please see screenshot below.
Any help would be appreciated.
Office Supplies first time =
VAR OfficeSuppliesCustomersJanuary2015 =
CALCULATETABLE(
VALUES(Orders[Customer Name] ),
FILTER(
Orders,
Orders[Product Category] = "Office Supplies" &&
Orders[Order Date] >= DATE(2015, 1, 1) &&
Orders[Order Date] <= DATE(2015, 1,31)
)
)
RETURN
COUNTROWS(
EXCEPT(
OfficeSuppliesCustomersJanuary2015,
CALCULATETABLE(
VALUES(Orders[Customer Name]),
FILTER(
Orders,
Orders[Product Category] = "Office Supplies" &&
Orders[Order Date] < DATE(2015, 1, 1)
)
)
)
)
Solved! Go to Solution.
Hi @gbarr12345
Wrap the COUNTROWS in an IF to return the desired text
IF (
COUNTROWS(
EXCEPT(
OfficeSuppliesCustomersJanuary2015,
CALCULATETABLE(
VALUES(Orders[Customer Name]),
FILTER(
Orders,
Orders[Product Category] = "Office Supplies" &&
Orders[Order Date] < DATE(2015, 1, 1)
)
)
)
) = 1,
"First Time"
)
Regards
Phil
Proud to be a Super User!
That worked! Thank you so much!!
Hi @gbarr12345
Wrap the COUNTROWS in an IF to return the desired text
IF (
COUNTROWS(
EXCEPT(
OfficeSuppliesCustomersJanuary2015,
CALCULATETABLE(
VALUES(Orders[Customer Name]),
FILTER(
Orders,
Orders[Product Category] = "Office Supplies" &&
Orders[Order Date] < DATE(2015, 1, 1)
)
)
)
) = 1,
"First Time"
)
Regards
Phil
Proud to be a Super User!
User | Count |
---|---|
99 | |
87 | |
81 | |
76 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |