I'd like to adjust these two measures so they default to the max year in the dataset when there are no filters applied i.e. without having to click on 2017, how can I have the cards default to the values for that year (or whatever the max year would be dynamically)?
1
votes
1 Answers
0
votes
Create a measure with this below code and just adjust the table and column names as per yours.
max_year_sales =
VAR max_year = MAX(Orders[yr])
RETURN SUMX(
FILTER(
Orders,
Orders[yr] = max_year
),
Orders[sales]
)
Now add this measure as a Card in the report. Initially it will show the Sales for latest year. And after that, if you select a row in matrix, the value in Card will change accordingly. See the initial data and data after selecting a row in the Matrix in the below image-

