Reply
avatar user
Anonymous
Not applicable

use dax funxtion to hide columns ,only show the columns i select

Hello , 
    i create three field ,and i seperate the data column name into these three field ,and i also add two slicer for the table selecting ,if i select nothing ,it will show all the columns ,if i select in all the filter ,then it will show the column i select.
   now i want the table to be if i select nothing ,it will only show the column that will always show[column 1],if i select the columns in the filter , it will show the columns with [column 1]
    how can i do to achieve this ? really thankful if somebody can answer my question.

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

Please try this:

Here I create a set of sample:

Table:

vzhengdxumsft_0-1730790916339.png

Then add a Fields Parameter:

Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

vzhengdxumsft_1-1730790972070.png

In the table view, add a calculated column in the Parameter table:

Column = MID('Parameter'[Parameter],1,8)

vzhengdxumsft_2-1730791069308.png

Finally, create a Slicer, the result is as follow:

vzhengdxumsft_3-1730791114103.png

vzhengdxumsft_4-1730791121006.png

vzhengdxumsft_7-1730791150924.png

 

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @Anonymous 

Please provide a workable sample data and your expected result from that. It is hard to figure out what you want to achieve from the description alone.  

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
avatar user
Anonymous
Not applicable

I create three field [AO],[Attribute],[Measure],column a are from [AO],column b are from [Attribute],column C from [Measure],each field multiple select is accepted , so there are maybe have situations like :

ag_cdcolumn acolumn b column b1column ccolumn c1column c2.... 
         
         
         
         
         
         
         
         
         

if i select nothing , i want the table to only show like this

ag_cd
 
 
 
 
 
 
 
 
 

Hi @Anonymous 

 

Please try this:

Here I create a set of sample:

Table:

vzhengdxumsft_0-1730790916339.png

Then add a Fields Parameter:

Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

vzhengdxumsft_1-1730790972070.png

In the table view, add a calculated column in the Parameter table:

Column = MID('Parameter'[Parameter],1,8)

vzhengdxumsft_2-1730791069308.png

Finally, create a Slicer, the result is as follow:

vzhengdxumsft_3-1730791114103.png

vzhengdxumsft_4-1730791121006.png

vzhengdxumsft_7-1730791150924.png

 

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)