Forum Discussion
Sum values until the first maximum value in another column per each category in another column
- 5 years ago
Amedeo,
I modified it a bit and I got what I needed. Instead of the single days (second column) I used the cumulative days as input.
This formula returned the amount of days required to reach the final depth
VAR_RESULT =CALCULATE (MIN (Table[DAY]),FILTER(Table, Table[DEPTH] = (MAX(Table[DEPTH]))))Many thanks for taking the time to help, much appreciated.RegardsElena - Anonymous5 years ago
No need to apologize Ecan20 🙂
Yes, that would be a single measure, in which you can define multiple variables and reference them in the same measure. I assumed you were using a fairly recent version of Power BI Desktop/Excel, in which you can define variables.
Are you using a recent version of Power BI Desktop/Excel/SQL Server Analysis Services?
I don't want to ask a stupid question either, but have you forgot to provide a name for your measure? That's the first thing I can think of.
If you miss that, you'll get an error:
With measure name instead:
This task does not have a solution since you have not stated how values are ordered. Without a column that tells you the order of values, the description is meaningless.
Hi daxer, thanks for the hint. But forgive me, I am a beginner and I don't understand what you mean by "the order of the values". Which values? What would you suggest me doing? Thanks!
- daxer-almighty5 years ago
Solution Sage
DAX does not have an intrinsic notion of order. All tables in the model are unordered, just like tables in SQL. So, in order to calculate something that resembles "running totals," you have to have a column that orders rows in the table. Otherwise, the result of aggregation will be indetermined/random.