Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi everyone!
I have a table showing Sales by Client and I am trying to filter it by Year, Month.
I also have to put in this table the same sale measure calculated on a different period that is chosen by the user using the slicers.
To achieve this, I have 4 filters:
Year
Month
Year_Comparison
Month_Comparison
The matrix I have is not filtered directly by any of the slicers. Because of this, I want to filter the sales measure using the SELECTEDVALUE function.
This is the measure I created:
@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.
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
I am selecting only one Year in the slicer, 2021.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.