Forum Discussion

dreyz64's avatar
dreyz64
Helper III
6 years ago

Dynamically Changing a Display column based on parameters (like in Tableau)

Hi everyone,

I am new to Power BI coming over from Tableau.

I am trying to reproduce a quite easy functionality from Tableau into Power BI but am failing miserably...

In Tableau, I was using so that the user could select what column to show:

 

 

 I would like to do this as well in Power BI. Measures are all calculated the same so it is really the data columns that are changing.

I created a separate table 'Fields to Show' with a column called Granularity. The column Granularity contains 2 rows: Location and POS (eg. Shop).

I am now trying to create a calculated column in my main table 'Daily COT' which would either be empty if 'Location' is selected in the table 'Fields to Show' or show the values of the column 'POS' in the Daily COT Table:

 

Column to Show = IF(SELECTEDVALUE('Fields to Show'[Granularity]) = "POS", 'Daily COT'[POS],BLANK())

 

However it does not take any of the values, it either takes POS (regardless of the filter) or blank.

 

Could you please help?

Thanks a lot

 

2 Replies