Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi -
I have below data in Table View and need a Dax formula to compute a column with the total based on prior week's computed number (prior total * factor) for each category:
Table: DATA
| Category | Date | factor | Total | calculation |
| A | 01/01/24 | - | 100 | |
| A | 01/08/24 | 1.01682 | 101.68 | (100*1.01682) |
| A | 01/15/24 | 1.01734 | 103.45 | (101.68*1.01734) |
| A | 01/22/24 | 1.01939 | 105.45 | (103.45*1.01939) |
| A | 01/29/24 | 1.01854 | 107.41 | (105.45*1.01854) |
| B | 01/01/24 | 1.01792 | 50 | |
| B | 01/08/24 | 1.01612 | 50.81 | |
| B | 01/15/24 | 1.01332 | 51.48 | |
| B | 01/22/24 | 1.01134 | 52.07 | |
| B | 01/29/24 | 1.01166 | 52.67 |
The code I've tried and failed (NaN) is below:
CALCULATION =
VAR _MINVALUE =
DATA[Total]
*CALCULATE(
SUM(DATA[factor]),
FILTER(DATA,DATA[Date]=MIN('DATA'[Date]])&&DATA[Category]=DATA[Category])
)
RETURN
IF(
DATA[Date]=MIN('DATA'[Date]])&&DATA[Category]=DATA[Category],
_MINVALUE,
CALCULATE(
PRODUCT(DATA[factor]),
FILTER(DATA,DATA[Date]<=EARLIER(DATA[Date])&&DATA[Category]=DATA[Category])
)*DATA[factor]
)
Thanks in advance.
Solved! Go to Solution.
Answered!
Column =
VAR TempTable = FILTER('Table','Table'[Category]=EARLIER('Table'[Category]) && 'Table'[Date]<=EARLIER('Table'[Date]))
VAR FirstVal = MAXX(TOPN(1,TempTable,'Table'[Date],1),'Table'[Total])
RETURN
PRODUCTX(
TempTable,
VAR MinDateOfCat = MINX(TempTable,'Table'[Date])
RETURN
IF('Table'[Date]=MinDateOfCat,1,'Table'[factor])
)*FirstVal
Answered!
Column =
VAR TempTable = FILTER('Table','Table'[Category]=EARLIER('Table'[Category]) && 'Table'[Date]<=EARLIER('Table'[Date]))
VAR FirstVal = MAXX(TOPN(1,TempTable,'Table'[Date],1),'Table'[Total])
RETURN
PRODUCTX(
TempTable,
VAR MinDateOfCat = MINX(TempTable,'Table'[Date])
RETURN
IF('Table'[Date]=MinDateOfCat,1,'Table'[factor])
)*FirstVal
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 54 | |
| 51 | |
| 39 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 79 | |
| 37 | |
| 27 | |
| 25 |