Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi all,
I have a challenge I would need some help with.
My setup:
* Sales table containing "Company ID", "Order Date", "Revenue".
* Company table containing dimensions (Relation to Company ID)
* Date table (Relation to Order Date)
I would like to do a running total showing number of companies (customers we have), based on their first order.
However, if a customer suddenly has not bought for 18 months, they should not be included in the next months.
Example:
Company A buys first time 1st Jan 2015. They are counted every month ahead. Let's say their last order is 31 May 2015, then they should be counted from Jan 2015 until Nov 2016 (18 months since 31 May 2015). After that, they should not be counted anymore. It is important that they are STILL counted all months before the 18 months, but only not counted after that period. How would I do that?
I have tried with this:
Hello,
Here I put an example of Companies and Order Date, and I added a column showing "CountUntil", meaning for how long this company (based on each order) should count in the rolling total companies.
| ID | Order Date | Last Until |
| A | 01-01-2015 | 24-06-2016 |
| A | 25-06-2015 | 16-12-2016 |
| A | 12-12-2015 | 04-06-2017 |
| A | 01-03-2016 | 23-08-2017 |
| A | 05-08-2016 | 27-01-2018 |
| A | 01-12-2016 | 25-05-2018 |
| B | 01-01-2015 | 24-06-2016 |
| B | 25-06-2015 | 16-12-2016 |
| B | 12-12-2015 | 04-06-2017 |
| B | 01-03-2016 | 23-08-2017 |
| B | 05-08-2016 | 27-01-2018 |
| B | 01-12-2016 | 25-05-2018 |
| B | 01-01-2017 | 25-06-2018 |
| B | 14-02-2017 | 08-08-2018 |
| C | 01-06-2017 | 23-11-2018 |
| C | 14-10-2017 | 07-04-2019 |
| C | 17-07-2018 | 08-01-2020 |
| C | 12-12-2019 | 04-06-2021 |
And here is my desired output:
Example: Company A has its first order Jan 2015, and its last order Dec 2016. It means it should count until May 2018 (Last Order + 18 months).
How do I make this in PBI?
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 |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |