You set input and output contexts with context operators in the extended syntax.
The In Operator
The In operator specifies dimensions explicitly in a context.

The example in the Max Quarterly Revenue figure shows a report with year and sales revenue. Your query also has the quarter dimension, but you do not add this to the block. Instead, you add a column to show the highest sales revenue by quarter for each year.
You can find where the values in the Max Quarterly Revenue column come from by comparing this block to one that includes the quarter dimension.
In Context Operator with Additional Dimension

The Max Quarterly Revenue break footer shows the highest quarterly revenue for each year. For example, Q4 has the highest revenue in 2024.
You use the In operator in the formula for Max Quarterly Revenue:
=Max([Sales revenue] In ([Year] ; [Quarter]))
This formula calculates the highest sales revenue for each year and quarter, then shows this value by year.
The Where Operator
The Where operator restricts the data used to calculate a measure.

For example, the variable Sales Revenue 2025 Q3 calculates the sales revenue for 2025 Q3:
=[Sales revenue] Where ([Year]="2025" And [Quarter]="Q3")
The In operator specifies the dimensions used in the calculation. The Where operator limits the data to find the measure.