user1664961
user1664961

Reputation: 35

Power bi filter column by slicer

I have a Clustered column chart and for the Legend field and have to switch between 2 columns based on a slicer:

I tried adding a calculated column like this

Column = IF(ISFILTERED(Table1[slicer]) = TRUE(), Table1[column1], Table1[column0])

And then use this column as Legend.

But this doesn't work!

Can you please advice me how to do it right?

Upvotes: 0

Views: 1351

Answers (1)

RADO
RADO

Reputation: 8148

You can't filter calculated columns by slicers.

Calculated columns are only calculated once - when you load/refresh your data model. After that, they contain fixed, static values that can not respond to slicers.

To achieve your goal, you will need to redesign your chart using measures, not calculated columns. Then your formula will look like this:

[Measure to Chart] = IF(ISFILTERED(Table1[slicer]), [Measure 1], [Measure 2])

If you want more help, I would recommend to post another question with more information about your data model and desired outcome.

Upvotes: 3

Related Questions