Forum Discussion
Passing single parameter to multiple fields and filtering data
- 7 years ago
Anonymous
You can use the below measure
Measure = var _f1=FIRSTNONBLANK(tbl1[Field1],1) var _f2=FIRSTNONBLANK(tbl1[Field2],1) var _f3=FIRSTNONBLANK(tbl1[Field3],1) var _checkf1=IF(SELECTEDVALUE(tbl2[inputField])<=_f1,1,0) var _checkf2 = IF(SELECTEDVALUE(tbl2[inputField])<=_f2,1,0) var _checkf3= IF(SELECTEDVALUE(tbl2[inputField])>=_f3,1,0) return _checkf1+_checkf2+_checkf3
Then use this measure in the visual filter and filter the values 3
I have got the following result.
If this helped you, please mark this post as an accepted solution and like to give KUDOS .
Regards,
Affan
Anonymous
You can use the below measure
Measure = var _f1=FIRSTNONBLANK(tbl1[Field1],1) var _f2=FIRSTNONBLANK(tbl1[Field2],1) var _f3=FIRSTNONBLANK(tbl1[Field3],1) var _checkf1=IF(SELECTEDVALUE(tbl2[inputField])<=_f1,1,0) var _checkf2 = IF(SELECTEDVALUE(tbl2[inputField])<=_f2,1,0) var _checkf3= IF(SELECTEDVALUE(tbl2[inputField])>=_f3,1,0) return _checkf1+_checkf2+_checkf3
Then use this measure in the visual filter and filter the values 3
I have got the following result.
If this helped you, please mark this post as an accepted solution and like to give KUDOS .
Regards,
Affan
Thank you verymuch Affan,
have another issue im facing with real time data.
as im using SSAS DirectQuery mode on also August2018 onpremise version im using.
may be for some reason SELECTEDVALUE function is not working.
instead i tried ALLSELECTED as below.
here issue is when i dont select any thing i should get data with out Filter,but my visual shows error.
because ALLSELECTED push all the values to compar.
any idea to overcome this.
or shal i try any other functions like HASONEFILTER
- affan7 years agoSolution Sage
Anonymous
You can try this
Measure = var _f1=FIRSTNONBLANK(tbl1[Field1],1) var _f2=FIRSTNONBLANK(tbl1[Field2],1) var _f3=FIRSTNONBLANK(tbl1[Field3],1) var _selvalue= FIRSTNONBLANK(tbl2[inputField],1) var _checkf1=IF(_selvalue<=_f1,1,0) var _checkf2 = IF(_selvalue<=_f2,1,0) var _checkf3= IF(_selvalue>=_f3,1,0) return _checkf1+_checkf2+_checkf3
If this helped you, please mark this post as an accepted solution and like to give KUDOS .
Regards,
Affan