Forum Discussion
IrisW
1 year agoRegular Visitor
Difficult sum
In my report, I have a date filter. With this I select one date, for example Dec. 31, 2023. My source data is structured as follows: ID Startdate Untildate Value 1 Nov. 1, 2023 Nov...
- 1 year ago
bhanu_gautam
Super User
1 year agoIrisW , Create a measure to find the largest Untildate per ID that is under the selected date.
Create another measure to sum the values corresponding to these largest Untildate values.
DAX
Max_Untildate_Under_Selected =
CALCULATE(
MAX('Table'[Untildate]),
FILTER(
'Table',
'Table'[Untildate] <= SELECTEDVALUE('Date'[Date])
)
)
Sum_Values_Largest_Untildate =
SUMX(
SUMMARIZE(
'Table',
'Table'[ID],
"Max_Untildate", [Max_Untildate_Under_Selected]
),
CALCULATE(
SUM('Table'[Value]),
'Table'[Untildate] = [Max_Untildate]
)
)