Forum Discussion
Using SELECTEDVALUE function when more than one value is selected in Filter
- 4 years ago
Well, what is the point of having a model which cannot do a simple thing? There is always an argument, to improve a model to simplify DAX or write complex DAX to achieve the results, and seems you are falling into 2nd category, which is usually not a good idea because it can have a performance impact and a solution which cannot be scaled over time.
Having said that, you can try this DAX function.
Sales_Amount = CALCULATE( Sum('Sales_Table'[Sales_Amount]), REMOVEFILTERS('Commision_Table'), TREATAS ( VALUES('Commision_Table'[Commision Year]), 'Order_Table'[Order Year] ) )✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
Well, what is the point of having a model which cannot do a simple thing? There is always an argument, to improve a model to simplify DAX or write complex DAX to achieve the results, and seems you are falling into 2nd category, which is usually not a good idea because it can have a performance impact and a solution which cannot be scaled over time.
Having said that, you can try this DAX function.
Sales_Amount =
CALCULATE(
Sum('Sales_Table'[Sales_Amount]),
REMOVEFILTERS('Commision_Table'),
TREATAS (
VALUES('Commision_Table'[Commision Year]),
'Order_Table'[Order Year]
)
)
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- rapingali4 years agoFrequent Visitor
Thank you. The DAX function TREATAS really worked.