Forum Discussion
Anonymous
2 years agoNot applicable
Sum using slicer
Hello Power Bi community, i have data in below format: Year Month Sales Profit 2023 1 24 11 2023 2 56 33 2023 2 76 22 2023 1 78 66 2023 2 98 33 2022 2 76 ...
- 2 years ago
Anonymous
I modified the year to accommodate 2024:Sales Compared Year = VAR __CurrentYear = SELECTEDVALUE( Table22[Year]) VAR __Year = SWITCH( __CurrentYear, 2022 , 2023, 2023, 2022, 2024 , 2023 ) VAR __Months = VALUES( Table22[Month] ) VAR __Result = CALCULATE( [Selected Year Sales], Table22[Year] = __Year, __Months ) RETURN
Fowmy
2 years agoSuper User
Anonymous
I modified the year to accommodate 2024:
Sales Compared Year =
VAR __CurrentYear = SELECTEDVALUE( Table22[Year])
VAR __Year =
SWITCH(
__CurrentYear,
2022 , 2023,
2023, 2022,
2024 , 2023
)
VAR __Months = VALUES( Table22[Month] )
VAR __Result =
CALCULATE(
[Selected Year Sales],
Table22[Year] = __Year,
__Months
)
RETURNAnonymous
2 years agoNot applicable
I am getting belwo error while using above created measure in the calculation:
what should i do?