Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hello,
The following sales table exists:
[Entry DateTime], [Customer], [Item Sales Qty.], [Sales Amount].
Task:
For a specified period (e.g. 11/15/20 - 12/25/20, column [Entry DateTime]), take into account the amount (column [Sales Amount]) of only the first sales of customers (column [Customer]) in the total quantity of items (column [Item Sales Qty.]) not more than e.g. four (<= 4), the next sales are ignored.
Note: The required quantity of items can be sold over the entire period, but not more than the specified quantity.
Each sales line may contain a different quantity of items, also the sales amount.
---------------------------------------
An addition to the task description.
As far the function meets the conditions, it ignores the next lines.
For example, with the client ABC01524
The function, at this customer should take into account the sum of 2 items for 02.12.2020 and the sum of 2 items for 03.12.2020, the sum of the other 6 items for 03.12.2020 the function should ignore, as well as the next sale for 11.12.2020.
Here is sample of data: https://drive.google.com/file/d/1V_Qvoa_FZJZjen-0Jzai2KdopfKvG3Dw/view?usp=sharing
Hello @Greg_Deckler,
I tried to describe the task more in detail.
I understood that the price per unit would be needed.
That's why I added a column with the price per unit to the data sample.
But most probably this task will be hard to implement.
But still.
An addition to the task description.
As far the function meets the conditions, it ignores the next lines.
For example, with the client ABC01524
The function, at this customer should take into account the sum of 2 items for 02.12.2020 and the sum of 2 items for 03.12.2020, the sum of the other 6 items for 03.12.2020 the function should ignore, as well as the next sale for 11.12.2020.
@beer_not_bear OK, thanks for the sample data, I have it downloaded. However, I do not fully understand what the results should be and why. Can you provide me a few rows of your expected output from the data you provided and explain how you got to those numbers?
Hi @Greg_Deckler ,
I provided an example of the data.
I lack my knowledge to deal with it.
Please, if you can help me.
Thank you @Greg_Deckler ,
I will try to implement your solution, if I fail I will provide a sample of data.
Have a nice evening.
@beer_not_bear - Difficult to say with specificity without testing out something. Sample data would help greatly. However, you should be able to find a MIN date using variables or EARLIER for a customer. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
__Current - __Previous
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 | |
| 40 | |
| 38 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 34 | |
| 33 | |
| 30 |