Forum Discussion
Priority Rules / Column in Table Visualisation
- 2 years ago
Brian415_
Create a dedicated table with unique values of product and do not create any relation between product list table and the actual data table. Put the product column from product list into the slicer create a measure using the below pattern.Condition_Check = Var SelectedProductCategories = CALCULATETABLE(VALUES('Data Table'[Category]), 'Data Table'[Product] = SELECTEDVALUE(ProductsTable[Product]), ALLSELECTED('Data Table')) Var __Condition = SWITCH( TRUE(), COUNTROWS( EXCEPT(SelectedProductCategories, {"A"})) = 0 , "A", COUNTROWS( EXCEPT(SelectedProductCategories, {"A","B"})) = 0 , "A", COUNTROWS( EXCEPT(SelectedProductCategories, {"B"})) = 0 , "B", COUNTROWS( EXCEPT(SelectedProductCategories, {"B","C"})) = 0 , "B", COUNTROWS( EXCEPT(SelectedProductCategories, {"C"})) = 0 , "C" ) Var result = IF(SELECTEDVALUE('Data Table'[Category]) = __Condition && SELECTEDVALUE(ProductsTable[Product]) = selectedvalue('Data Table'[Product]), 1, 0) return resultYou should use this meausre as a visual lelvel filter. I am attaching the file for your reference.
If the post helps please give a thumbs up
If it solves your issue, please accept it as the solution to help the other members find it more quickly.
Tharun
Brian415_
Create a dedicated table with unique values of product and do not create any relation between product list table and the actual data table. Put the product column from product list into the slicer create a measure using the below pattern.
Condition_Check =
Var SelectedProductCategories = CALCULATETABLE(VALUES('Data Table'[Category]), 'Data Table'[Product] = SELECTEDVALUE(ProductsTable[Product]), ALLSELECTED('Data Table'))
Var __Condition = SWITCH( TRUE(),
COUNTROWS( EXCEPT(SelectedProductCategories, {"A"})) = 0 , "A",
COUNTROWS( EXCEPT(SelectedProductCategories, {"A","B"})) = 0 , "A",
COUNTROWS( EXCEPT(SelectedProductCategories, {"B"})) = 0 , "B",
COUNTROWS( EXCEPT(SelectedProductCategories, {"B","C"})) = 0 , "B",
COUNTROWS( EXCEPT(SelectedProductCategories, {"C"})) = 0 , "C"
)
Var result = IF(SELECTEDVALUE('Data Table'[Category]) = __Condition && SELECTEDVALUE(ProductsTable[Product]) = selectedvalue('Data Table'[Product]), 1, 0)
return result You should use this meausre as a visual lelvel filter. I am attaching the file for your reference.
If the post helps please give a thumbs up
If it solves your issue, please accept it as the solution to help the other members find it more quickly.
Tharun
I will try this and keep you updated. Thanks!