Forum Discussion
Use SELECTEDVALUE in a measure
carlottaf , Are you selecting any value from the slicer?
Try like
Selected_Year = maxx(allselected(Calendar), Calendar[Year)
Then
Sales =
Var Calendar_Year = [Selected_Year]
Return
CALCULATE(SUM('Documento-Riga'[Netto riga]),
FILTER('Documento-Riga', YEAR('Documento-Riga'[Data]) = Calendar_Year),
)
I tried, but it returns the wrong calculation.
- Anonymous5 years agoNot applicable
Hi carlottaf,
Selectedvalue function can be used to get the current row contents(include filter effects), it will return blank if the current row content has multiple values. You need to add the 'alternate Result' parameter to handle multiple value results.
SELECTEDVALUE function - DAX | Microsoft Docs
BTW, Can you please share some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng