Dynamically change chart axis in Power BI

 https://www.youtube.com/watch?v=n-OWNaCUU0o

Steps:

Duplicate Product table and name new table ProductUnpivot

Select Product and Color in new table; make sure they are the same type; Unpivot. Now you have ProductKey, Attribute and Value columns in the new table.

1 to many relationship between Product and ProductUnivot

Create slicer on ProductUnpivot[Attribute] - values are Product and Color

Bar chart with ProductUnpivot[Value]

Create new measure Dynamic Sales = 

CALCULATE([Sales], 

CROSSFILTER(Product[ProductKey], ProductUnpivot[ProductKey]

)

Use CROSSFILTER instead of changing relationship Cross Filter Direction to BOTH



Comments

Popular posts from this blog

Difference between DISTINCT and VALUES in DAX