Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
RMSLUIS
Frequent Visitor

Targeting By Frequency

Hello,

I'm a new user in Power BI and I need help to targeting users in each target. Basically we have a transactions BD with respetive user, by date. We want to define a target for each user.

 

Thanks,

Rui Luís

 

The target rules are:

TARGETRule
Lover≥ 4 transactions in 4 different weeks
Regular2 or 3 transactions
Occasionalothers

 

The transactions BD:

ID_TRANSACTIONUSERDATEWEEK
1001A02-02-20195
1002B02-02-20195
1003B02-02-20195
1004B02-02-20195
1005C10-02-20196
1006A10-02-20196
1007B10-02-20196
1008F11-02-20197
1009G11-02-20197
1010C11-02-20197
1011A20-02-20198
1012C02-03-20199
1013A03-03-20199
1014A06-03-201910
1015A07-03-201910

 

 

The expected results are:

USERTARGET
ALover
BRegular
CRegular
FOccasional
GOccasional

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@RMSLUIS ,

You could create the following Measure:

Target = 
var weeks = DISTINCTCOUNT(transactions[WEEK])
var tx = COUNT(transactions[ID_TRANSACTION])
return SWITCH(
    TRUE(),
    weeks >=4, "Lover",
    tx < 2, "Occasional",
    "Regular"
)

Cheers!

Nathan

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@RMSLUIS ,

You could create the following Measure:

Target = 
var weeks = DISTINCTCOUNT(transactions[WEEK])
var tx = COUNT(transactions[ID_TRANSACTION])
return SWITCH(
    TRUE(),
    weeks >=4, "Lover",
    tx < 2, "Occasional",
    "Regular"
)

Cheers!

Nathan

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.