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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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