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.
Hello All,
I have a table with products that I need to know how many customers have removed a certain item from their package.
I tried the following formula but did not work:
I also want to remove the customer ID because I am only interested in knowing the total of packages removed.
This would also apply for the upgrades:
If customer never had that product and has just acquired:
Solved! Go to Solution.
@lbendlin that is just amazing! thank you so much for looking into this. It is a very good solution. I will download to excel to find the total of customer per month! 🙂
@lbendlin that is just amazing! thank you so much for looking into this. It is a very good solution. I will download to excel to find the total of customer per month! 🙂
Here's what I have so far:
1. Create a reference table for the cross Join
Reference = CROSSJOIN(VALUES(bidowngrade[package]),VALUES(bidowngrade[date]))
2. Add the required measures
Additions =
var c= SELECTEDVALUE(Reference[date])
var p= CALCULATE(max(Reference[date]),Reference[date]<c)
var cv=CALCULATE(sum(bidowngrade[amount_usd]),bidowngrade[date]=c,TREATAS(VALUES(Reference[package]),bidowngrade[package]))
var pv=CALCULATE(sum(bidowngrade[amount_usd]),bidowngrade[date]=p,TREATAS(VALUES(Reference[package]),bidowngrade[package]))
return if(ISBLANK(pv) && not ISBLANK(cv),1,0)
Deletions =
var c= SELECTEDVALUE(Reference[date])
var p= CALCULATE(max(Reference[date]),Reference[date]<c)
var cv=CALCULATE(sum(bidowngrade[amount_usd]),bidowngrade[date]=c,TREATAS(VALUES(Reference[package]),bidowngrade[package]))
var pv=CALCULATE(sum(bidowngrade[amount_usd]),bidowngrade[date]=p,TREATAS(VALUES(Reference[package]),bidowngrade[package]))
return if(ISBLANK(cv) && not ISBLANK(pv),1,0)
Increases =
var c= SELECTEDVALUE(Reference[date])
var p= CALCULATE(max(Reference[date]),Reference[date]<c)
var cv=CALCULATE(sum(bidowngrade[amount_usd]),bidowngrade[date]=c,TREATAS(VALUES(Reference[package]),bidowngrade[package]))
var pv=CALCULATE(sum(bidowngrade[amount_usd]),bidowngrade[date]=p,TREATAS(VALUES(Reference[package]),bidowngrade[package]))
return if(cv>pv,1,0)
Decreases =
var c= SELECTEDVALUE(Reference[date])
var p= CALCULATE(max(Reference[date]),Reference[date]<c)
var cv=CALCULATE(sum(bidowngrade[amount_usd]),bidowngrade[date]=c,TREATAS(VALUES(Reference[package]),bidowngrade[package]))
var pv=CALCULATE(sum(bidowngrade[amount_usd]),bidowngrade[date]=p,TREATAS(VALUES(Reference[package]),bidowngrade[package]))
return if(pv>cv,1,0)
3. Add a cleanup filter for rows without data
Changed = [Additions]+[Decreases]+[Deletions]+[Increases]
4. Apply the filter
This kinda works but is very slow. I may need to rethink my approach. See attached.
Hi @lbendlin, this should also ben counted as downgrade or upgrade. Hope it is possible. Thank you for looking after it!
Hi @lbendlin ,
Thank you so much for looking into this.
This is the sample file: https://drive.google.com/file/d/1moc4Wfji52Gklmf-T2Q1wzVN4FHBBcIj/view?usp=sharing
The outcome is :
Date | Premier Dowgrade | Essencial Downgrade | Payment Processing Downgrade | ||
Oct 2021 | 5 | 10 | 15 | ||
Nov 2021 | 8 | 10 | 12 |
The goal is to count how many packages have been added or removed per month.
I look forward to hearing from you.
thank you for the sample data. I see that some packages have changed value from one month to the other - how should that be represented?
Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.
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 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |