Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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"))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |