Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have to calculate the cumulative quantity by weeks number. I have created a custom column "Wee Nr" that return the week number from a column data.
I have tried with this formulas without success :
Cumulative quantity by Week =
CALCULATE(
SUM('Table'[Quantity]),
FILTER(
ALL('Table'[Week Nr]),
'Table'[Week Nr] <= Max('Table'[Week Nr])
)
)
Cumulative quantity by weeks =
CALCULATE(
SUM('Table'[Quantity]),
FILTER(
ALLSELECTED(Table.[Date]),
WEEKNUM(Table.[Date], 2) <= MAX([Week Nr]) && 'Table'.[Date] <= MAX('Table'.[Date])
)
)
Does anyone have an idea what's wrong with my formulas ?
Many thanks
I've created this quick measure which return exactly what I need
CALCULATE(
SUM('Table'[Quantity]),
FILTER(
ALLSELECTED('Table'[Week Nr]),
ISONORAFTER('Table'[Week Nr], MIN('Table'[Week Nr]), DESC)
)
)
And the result is :
Actually the problem is when I start to use the filter "Week Nr" it doesn't work well and it displays me the total per week and not the cumulative.
Note: the "Week Nr" column is a whole number as type. How can I fix that ?
Thank you for your reply!
many thanks @Anonymous
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |