Forum Discussion
OpenRoad
9 years agoNew Member
Filter Dataset by Secondary Column Only
I'm trying to figure out how to filter a dataset to by a secondary column only. In Excel the non-optimal workaround is to have two slicers (eg. one for store and one for product and after selectin...
v-jiascu-msft
Microsoft Employee
9 years ago
Hi, OpenRoad
You could not achieve your goal if you do this in one table. Creating another table would make this easier.
1. Create a new table with only stores. (Copy the table, keep just column STORE, delete duplicates. )
2. Delete the relationship if Power BI creates it automatically.
3. Create a measure like this.
Measure =
IF (
HASONEVALUE ( 'DataTable2'[Store] ),
IF (
MIN ( 'DataTable'[Product] )
IN CALCULATETABLE (
VALUES ( 'DataTable'[Product] ),
FILTER (
ALL ( 'DataTable' ),
'DataTable'[Store] = VALUES ( DataTable2[Store] )
)
),
"y",
BLANK ()
),
0
)
Hope this would be a little help.
v-jiascu-msft
Microsoft Employee
9 years ago