daOnlyBG
daOnlyBG

Reputation: 601

Is there a way to filter which columns are visible in PowerBI visual?

Question: how can I use PowerBI's features to help me "filter out" which columns I'd like to see in my visual?

For example, observe the columns below (the ones in blue are measures, whereas the others are simply columns). I'd like to be able to filter out "Ferrari" data and "Porsche" columns separately; that is, there'd be a "Ferrari" option in the slicer to allow me to see columns 2-4, and another option (i.e., "Porsche") in the slicer would allow me to see columns 5-7.

enter image description here

Thank you in advance!

If anyone would like a workable example, you can click here to see the data.

Upvotes: 0

Views: 1167

Answers (1)

Leonard
Leonard

Reputation: 2578

The best way to approach this would be to unpivot your data & add a column to distinguish between Ferrari and Porsche.

i.e. Instead of:

Unpivoted

Do this:

Pivoted

Notice the extra column to distinguish between Ferrari and Porsche. That extra column is what you'd then use on your slicer:

Final result

By unpivoting, this problem becomes easy to solve whereas working with pivoted data will always lead to very complicated DAX expressions. (Not saying that this can't be solved in DAX, but I don't recommend trying.)

Also, note that unpivoting can be performed in the Query Editor as you load your data into Power BI. It's not something you have to do your source data outside Power BI (unless you want to).

Upvotes: 1

Related Questions