Power bi filter column by slicer

爱⌒轻易说出口 提交于 2019-12-11 18:51:28

问题


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

  • if no slicer is filtered then use column0 for Legend
  • if slicer is filtered then use column1 for Legend

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?


回答1:


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.



来源:https://stackoverflow.com/questions/52149070/power-bi-filter-column-by-slicer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!