Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Previous value in DAX

Hello,
 
I would like to use two sets of values for one timestamp, i.e. [Date].
Thus, all values before today, including today, have to be equal to value3. All values after today have to be equal to MIN(value1, value2) + previous day's value. Thus, tomorrow's value = today's value + MIN(value1, value2) or something like that:
 
IF(([Date]) > Today(),
    PrevValue + MIN(value1, value2),
    value3
)

Could you please help with introducing the Previous Value into the calculation.
4 REPLIES 4
FreemanZ
Super User
Super User

hi @Anonymous 

try like:

VAR PrevValue =
MAXX(
   FILTER(
      TableName,
      TableName[Date]=EARLIER(TableName[Date])-1
    ),
   TableName[Value]
)
Anonymous
Not applicable

@FreemanZ when you use TableName[Value], what value is it?

hi @Anonymous 

i was assuming you have a tablename[value] column

Anonymous
Not applicable

@FreemanZ In my case all three values are measures.
So, I would like to use values from value1 (or measure 1) until tommorrow, and then use either value2 or value3 (or measure 2 or measure 3) for future dates. At the same time I would like to connect this two sets values in form of a cumulative total.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.