Forum Discussion
Problem with SELECTEDVALUE
- Anonymous5 years ago
Hi Pfoerster
Selectvalue function can only be used to single select value.
Please try value function to get mulitiple values and use in instead of "=" in your measure.
My sample:
Month hist table and Month Fut table are the same.
Measure:
fut filter = VAR _SelectMonthhist = VALUES('Month fut'[Month fut]) Return IF(ISFILTERED('Month fut'[Month fut]),IF(MAX('Table'[Month]) in _SelectMonthhist,1,0),0)hist filter = VAR _SelectMonthhist = VALUES('Month hist'[Month hist]) Return IF(ISFILTERED('Month hist'[Month hist]),IF(MAX('Table'[Month]) in _SelectMonthhist,1,0),0)I build two table visuals to show the result. Add hit filter in filter field in one visual and set it to show items when value =1. Add fut filter in filter field in other visual and do the same option.
Result:
By default two visuals will show blank.
Select Jan,Feb,Mar in Month hist and select Aug,Sep,Oct in Month fut.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Pfoerster not sure what you mean by sum selectedvalue, if more than one value is selected, it will return blank, you can use values function to get the list of months selected.
COUNTROWS ( VALUES ( Table[Month] ) )
Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts 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.⚡