Forum Discussion
Petanek333
Helper III
4 years agoDAX Measure summing values between today and selected date
Hi, I would greatly appreciate it if you could help me with creating a measure. I have an import from an SQL database (Table 1) that gives me a stock quantity of various product IDs at the time o...
- 4 years ago
Hi,
I am not sure how your data model looks like, but I tried to create a sample pbix file like below.
I suggest having a calendar table.
Please check the below picture and the attached pbix file.
Quantity measure: = IF ( MAX ( 'Calendar'[Date] ) <= TODAY (), SUM ( Data[Quantity] ) + CALCULATE ( SUM ( 'Table One'[Change] ), 'Table One'[Date] >= MAX ( 'Calendar'[Date] ) ) + CALCULATE ( SUM ( 'Table Two'[Change] ), 'Table Two'[Date] >= MAX ( 'Calendar'[Date] ) ) )
Jihwan_Kim
Super User
4 years agoHi,
I am not sure how your data model looks like, but I tried to create a sample pbix file like below.
I suggest having a calendar table.
Please check the below picture and the attached pbix file.
Quantity measure: =
IF (
MAX ( 'Calendar'[Date] ) <= TODAY (),
SUM ( Data[Quantity] )
+ CALCULATE (
SUM ( 'Table One'[Change] ),
'Table One'[Date] >= MAX ( 'Calendar'[Date] )
)
+ CALCULATE (
SUM ( 'Table Two'[Change] ),
'Table Two'[Date] >= MAX ( 'Calendar'[Date] )
)
)- Petanek3334 years ago
Helper III
Works perfectly thank you very much!