Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi people!
I have the following table with id_product, date, sells and available_minutes. Every day the database is updated, to check how many sells the product was for sale. The available_minutes is to check if the product has stock above zero. As I want the average sales (sales/week), if I make a calculation divided by 1 week, I will be considering when there is zero stock. So I want to consider the period of 1 week that the stock is available.
So I created a measure of cumulative sum of minutes:
_accumulate_minutes = CALCULATE(sum('Table'[available_minutes]),FILTER(ALL('Table'[date]),[date]<=MAX('Table'[date])))
So I have this table
As you can see, the total sum for the measure is wrong. I think I should try summarize or addcollumns, but I already tried and did not get the result. But what I really want is to sum the sells for 1 period and 2 periods for each id_product. Each period has 10.080 minutes, so 1 period is 10080 and 2 periods 20160.
Hope someone can help me 🙂
Thanks!
André Gewehr
I think I made it clear, I want the sum of sales depending on the values of the accumulated minutes.
Sorry,
For the id_product (1) and for each period, I want the following sum of sells:
- If accumulate minutes <= 10080, sum sells = 10
- If accumulate minutes <= 20160, sum sells = 22
id_product | accumulate_minutes | sum_sells |
1 | 10080 | 10 |
1 | 20160 | 22 |
Hi,
Clearly show the expected result.
User | Count |
---|---|
84 | |
82 | |
66 | |
52 | |
46 |
User | Count |
---|---|
100 | |
48 | |
42 | |
39 | |
38 |