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.
Hi all,
So I'm very new to Power BI and DAX but doing my best to learn.
I am currently trying to apply an RFM model to a very big set of customer and sales data spanning multiple countries.
So far I've managed just fine to set up measures for "Last Transaction Date", "Recency", "Frequency" and "Monetary".
And it works just fine when I do a summary of all customers and get their measures.
Also, based on the tutorials I've seen so far, it's easy enough to assign values based on the percentiles for a given measure.
Seen here for the Recency value.
However, this (of course) compares customers from different countries. As the customers may vary to a great extend I would like to group by country and then do the percentile calculation.
I've tried a bunch of different ways but nothing really works (mostly because I don't really know what I am doing 😅).
My thoughts went something like these examples below, which are clearly not working.
Can anybody point me in the right direction?
Or something like this, which at least gave a value, but totally wrong.
Any and all help would be greatly appreciated 🙂
Solved! Go to Solution.
Hi @stephras ,
Here are the steps you can follow:
1. Create calculated column.
New Recency Score =
SWITCH(
TRUE(),
'Table'[Recency values]<=PERCENTILEX.INC(FILTER(ALL('Table'),'Table'[country]=EARLIER('Table'[country])),[Recency values],0.25),4,
'Table'[Recency values]<=PERCENTILEX.INC(FILTER(ALL('Table'),'Table'[country]=EARLIER('Table'[country])),[Recency values],0.5),3,
'Table'[Recency values]<=PERCENTILEX.INC(FILTER(ALL('Table'),'Table'[country]=EARLIER('Table'[country])),[Recency values],0.75),2,1)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @stephras ,
Here are the steps you can follow:
1. Create calculated column.
New Recency Score =
SWITCH(
TRUE(),
'Table'[Recency values]<=PERCENTILEX.INC(FILTER(ALL('Table'),'Table'[country]=EARLIER('Table'[country])),[Recency values],0.25),4,
'Table'[Recency values]<=PERCENTILEX.INC(FILTER(ALL('Table'),'Table'[country]=EARLIER('Table'[country])),[Recency values],0.5),3,
'Table'[Recency values]<=PERCENTILEX.INC(FILTER(ALL('Table'),'Table'[country]=EARLIER('Table'[country])),[Recency values],0.75),2,1)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks! it worked 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |