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!View all the Fabric Data Days sessions on demand. View schedule
Hello
I was trying to summarize a field, grouping it by the day before according to the most current date (D-1), the problem is that I noticed the dataset not always has the data from a previous day (sometimes is D-2 or D-5, etc.), So I need a Measure capable to detect the data from the max date previous the current date, here is my try, it just Summarize D-1, could you help me, guys?
D-1 = VAR DateFilter =
SELECTCOLUMNS ( VALUES ( Agencies_Inventory[date]), "Date-1", Agencies_Inventory[date]-1)
RETURN
CALCULATE (
SUM(Agencies_Inventory[envase_disponible]),
ALL ( 'Agencies_Inventory' ),
INTERSECT ( ALL ( 'Agencies_Inventory'[date] ), DateFilter )
)
Solved! Go to Solution.
D-1 =
VAR D = SELECTEDVALUE(Agencies_Inventory[date])
VAR P = CALCULATE(MAX(Agencies_Inventory[date]),ALL ( 'Agencies_Inventory' ),Agencies_Inventory[date]<D)
RETURN CALCULATE (
SUM(Agencies_Inventory[envase_disponible]),
ALL ( 'Agencies_Inventory' ),
,Agencies_Inventory[date]=P
)
D-1 =
VAR D = SELECTEDVALUE(Agencies_Inventory[date])
VAR P = CALCULATE(MAX(Agencies_Inventory[date]),ALL ( 'Agencies_Inventory' ),Agencies_Inventory[date]<D)
RETURN CALCULATE (
SUM(Agencies_Inventory[envase_disponible]),
ALL ( 'Agencies_Inventory' ),
,Agencies_Inventory[date]=P
)
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!