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,
I have this (simplified) datamodel:
ID | Opt_In | Date |
001 | True | 01-01-2021 |
001 | True | 02-01-2021 |
001 | False | 03-01-2021 |
002 | True | 02-01-2021 |
002 | False | 03-01-2021 |
003 | True | 04-01-2021 |
Some remarks:
What I want to show is the daily variation. So not only the total amount of subscribers (Opt_In = True) per day, but also the variance based on the number of new subscribers on a day and the number of unsubscribers on a day.
And this on a day per day basis 🙂
So more or less:
Date | Total subscribers | New subscribers | Leaving subscribers |
30-06-2021 | 5000 | 5 | 3 |
31-06-2021 | 5010 | 15 | 5 |
where the total subscribers of 31-06 is the total subscribers of 30-06 + new on the 31st and leaving on the 31st.
How can I achieve that? Any help is very much appreciated!
Solved! Go to Solution.
@Spekko , With sample data I am not able to relate the result
Try measures like
new till date = calculate(distinctCOUNT(Table[ID]), filter(all(Table[Date]), Table[Date] <= Max(Table[Date]) && Table[Opt_In] = true()))
out till date= calculate(distinctCOUNT(Table[ID]), filter(all(Table[Date]), Table[Date] <= Max(Table[Date]) && Table[Opt_In] = false()))
remaining till date = [new till date] -[Out till date ]
Hi all,
After some struggles, I managed to solve this with another approach. With this formula, I can mark the first time a line has been added:
Opt-In FA = if('Table'[opt_in_newsletter]="true",'Table'[scrape_time] =
CALCULATE(
MIN('Table'[scrape_time]),
FILTER(ALL('Table'), 'Table'[email]=EARLIER('Table'[email]))
),false)
Based on that and variants for opt-outs I can count the number of new subscriptions and leaving subscriptions per day.
Thank you for your patience.
Hi @Spekko ,
Can you expand your sample data and show the corresponding expected results based on your sample data?
The text description makes me a little confused.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Spekko , With sample data I am not able to relate the result
Try measures like
new till date = calculate(distinctCOUNT(Table[ID]), filter(all(Table[Date]), Table[Date] <= Max(Table[Date]) && Table[Opt_In] = true()))
out till date= calculate(distinctCOUNT(Table[ID]), filter(all(Table[Date]), Table[Date] <= Max(Table[Date]) && Table[Opt_In] = false()))
remaining till date = [new till date] -[Out till date ]
@amitchandak thank you for taking the time to help. I tried this with my available data-fields, leading to this formula:
Alternatives I tried is "true" instead of true and creating it as a calculated column instead of a measure (based on some content I found online on this matter).
I'm sorry: not very tech-savvy and there's no DAX experience within our organisation...
@Spekko , is this not a column opt_in_newsletter ?
or this a measure?
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 |
---|---|
100 | |
99 | |
86 | |
71 | |
67 |
User | Count |
---|---|
116 | |
109 | |
94 | |
79 | |
72 |