Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hello everyone,
I have the table (example) below, it contains dates of orders, email of the client and a “New Customer Flag” (nc_flag with 1 as new customer NC and 0 as returning RC) (this flag has to be imported directly on the table and can’t be a calculated one because I won’t have the full dataset.
The challenge I’m facing is how to use the nc_flag with varying levels of date granularities, for example, client aaa has an order on both the first and second of January, if I’m using a daily granularity the client should appear as a NC (new customer) on the first day and as a RC on the second, however if I’m using a monthly granularity he should only appear as a NC (basically the flag should be the max of the flag depending on the granularity.
I’ve managed to create a measure to calculate the Unique Customers (for NC and RC separately) however I will also need to filter them based on the flag that they have so I’ll need more that this measure.
Can anyone provide some advice on how to achieve this?
Thank you,
The table and measure:
| Date | nc_flag | |
| 1/1/2021 | aaa | 1 |
| 1/2/2021 | aaa | 0 |
| 1/3/2021 | bbb | 0 |
| 2/4/2021 | bbb | 0 |
| 1/5/2021 | ccc | 1 |
Measure 3 =
VAR summary = SUMMARIZE(Sheet1,Sheet1[Email],"count",max(Sheet1[nc_flag]))
VAR filtered = FILTER(summary,[count]=1)
RETURN COUNTROWS(filtered)
Solved! Go to Solution.
Hi @Anonymous
You can create a measure as a second flag to filter email accounts.
Flag Measure =
var maxNCFlag = MAX('Table'[nc_flag])
return
if(maxNCFlag=1,1,0)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Anonymous
You can create a measure as a second flag to filter email accounts.
Flag Measure =
var maxNCFlag = MAX('Table'[nc_flag])
return
if(maxNCFlag=1,1,0)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
To expand some more on the challange I basically need to consider only the first order of each client for that period (the client will always be a NC before being a RC). The problem here is that I need to filter the clients based on their first order after this one has been calculated depending of the time granularity.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 35 | |
| 31 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 75 | |
| 72 | |
| 39 | |
| 35 | |
| 23 |