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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Filter Columns in Table Based on Filter

Hi,

 

Is there a way to filter columns in a table? for example, in the table below, if no Month is selected, I want to show the fields ENTRIES test, % Entries Full Year, and Count Weekday Full Year.

 

If I click on a certain month, I only want the ENTRIES test, % Entries, and Count Weekday fields to be shown.


Is this possible?

Capture.PNG

 

Thank you!
Sarah

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, you could try this way to get it:

Step1:

Add a new table that contains these five measures name

6.JPG

Step2:

Then create a measure as below

Measure =
SWITCH(SELECTEDVALUE('Columns'[Type]),
"ENTRIES test",[ENTRIES test],
"% Entries Full Year",IF(ISFILTERED('Table'[Month]),BLANK(),[% Entries Full Year]),
"Count Weekday Full Year",IF(ISFILTERED('Table'[Month]),BLANK(),[Count Weekday Full Year]),
"% Entries",IF(ISFILTERED('Table'[Month]),[% Entries],BLANK()),
"Count Weekday",IF(ISFILTERED('Table'[Month]),[Count Weekday],BLANK()))

Step3:

Now drag Type field into columns of matrix visual and this measure instead of these five measure into visual.

 

here is simple sample pbix file.

Result:

7.JPG8.JPG

 

Regards,

Lin

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, you could try this way to get it:

Step1:

Add a new table that contains these five measures name

6.JPG

Step2:

Then create a measure as below

Measure =
SWITCH(SELECTEDVALUE('Columns'[Type]),
"ENTRIES test",[ENTRIES test],
"% Entries Full Year",IF(ISFILTERED('Table'[Month]),BLANK(),[% Entries Full Year]),
"Count Weekday Full Year",IF(ISFILTERED('Table'[Month]),BLANK(),[Count Weekday Full Year]),
"% Entries",IF(ISFILTERED('Table'[Month]),[% Entries],BLANK()),
"Count Weekday",IF(ISFILTERED('Table'[Month]),[Count Weekday],BLANK()))

Step3:

Now drag Type field into columns of matrix visual and this measure instead of these five measure into visual.

 

here is simple sample pbix file.

Result:

7.JPG8.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
az38
Community Champion
Community Champion

Hi @Anonymous 

no, sorry

only play with bookmarks


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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