Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
winston_min
Regular Visitor

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 @winston_min 

 

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 @winston_min 

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-...

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

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 @winston_min 

 

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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.