Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi
I am not able to get the sum of amount from previous week. It seems like the second filter in my expression is causing the trouble...
cash_lastWeek = CALCULATE( SUM(
factTable[amount]
); FILTER( ALL(calendar); calendar[YearWeek] = MAX(calendar[YearWeek]) - 1); FILTER( factTable;factTable[dataSource] = "CashReport")
)
Removing the filter for "CashReport" the values seems to follow changes in "YearWeek" field.
Br Espen
Solved! Go to Solution.
I figured out somthing that does work, it might not be the most delicate solution.
Here's what I did:
prev_Cash = CALCULATE(
SUM(factTable[amount]);
FILTER(ALL(calendar); calendar[YearWeek] = MAX(calendar[YearWeek]) - 1);
FILTER(ALL(factTable[dataSource]);factTable[dataSource] = "CashReport"))
something like this?
pre_sales = var enddate = MIN(Table2[Date])-1 var startdate = enddate - 6 return CALCULATE(SUM(Table2[Amt]),DATESBETWEEN(Table2[Date],startdate,enddate),ALLSELECTED(Table2[WeekNumber]) )
I figured out somthing that does work, it might not be the most delicate solution.
Here's what I did:
prev_Cash = CALCULATE(
SUM(factTable[amount]);
FILTER(ALL(calendar); calendar[YearWeek] = MAX(calendar[YearWeek]) - 1);
FILTER(ALL(factTable[dataSource]);factTable[dataSource] = "CashReport"))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 73 | |
| 50 | |
| 46 | |
| 44 |