Forum Discussion
estgas
8 years agoFrequent Visitor
Switch a visualized table column with slicer
Hi All, after reading several posts on similar topic I could not find one solving my issue. I have a table with columns: Product, Subcategory, Category, Date and Sales value and would like a visu...
v-yulgu-msft
8 years agoMicrosoft Employee
Hi estgas,
One choice is to unpivot your table structure. Select [Category], [SubCategory] and [Product], click the "Unpivot Columns" option. You will get a new table structure as shown in second screenshot. Drag field [Attribute] into slicer, add [Value] and [Sales] into a table visual.
If you don't want to change the soucre table structure (Suppose source table is named as 'Test1'), you may need some auxilliary tables.
'Test2'
'Test3'
Test3 =
UNION (
SELECTCOLUMNS ( Test1, "Cat", Test1[Category], "Sales", Test1[Sales] ),
SELECTCOLUMNS ( Test1, "Cat", Test1[SubCategory], "Sales", Test1[Sales] ),
SELECTCOLUMNS ( Test1, "Cat", Test1[Product], "Sales", Test1[Sales] )
)
Create a one to many relationship between Test2 and Test3.
Insert a table visual to host data from 'Test3', add 'Test2'[Group Type] into slicer.
Best regards,
Yuliana Gu
- Daniil8 years agoKudo Kingpin
You can try this: https://xxlbi.com/blog/dynamic-hierarchies-in-power-bi/