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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Show / Hide column based on condition or slicer

I have the data like below,

 

Mani1205_0-1593166763739.png

 



I would like add a slicer showing Price and Percentage , Based on the selection from slicer col from table/Matrix should hide / show ... lets say i have selected Price then expected output is like below. ( I am able to acheive like values are hiding/showing  based on my selection but not like below) 

Mani1205_1-1593166802458.png

 


I am able to achieve like below if selection is on price from slicer but pecentage col should hide.

Mani1205_2-1593166858389.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

Go to query editor>select column "Percentage" and "Price",choose "unpivot the columns";

Then create a slicer table as below:

 

Slicer = DISTINCT('Table (2)'[Category])

 

And a measure as below;

 

Measure 2 = IF(ISFILTERED('Slicer'[Category]),CALCULATE(MAX('Table (2)'[Value]),FILTER('Table (2)','Table (2)'[Category]=SELECTEDVALUE(Slicer[Category]))),MAX('Table (2)'[Value]))

 

And you will see:

Annotation 2020-06-29 143253.pngAnnotation 2020-06-29 143306.pngAnnotation 2020-06-29 143316.png

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

5 REPLIES 5
StuBee123
Frequent Visitor

Would the above slicer work around still work if there was data from two separate queries in the table and measures in the table also? 

Anonymous
Not applicable

Hi  @Anonymous ,

 

Go to query editor>select column "Percentage" and "Price",choose "unpivot the columns";

Then create a slicer table as below:

 

Slicer = DISTINCT('Table (2)'[Category])

 

And a measure as below;

 

Measure 2 = IF(ISFILTERED('Slicer'[Category]),CALCULATE(MAX('Table (2)'[Value]),FILTER('Table (2)','Table (2)'[Category]=SELECTEDVALUE(Slicer[Category]))),MAX('Table (2)'[Value]))

 

And you will see:

Annotation 2020-06-29 143253.pngAnnotation 2020-06-29 143306.pngAnnotation 2020-06-29 143316.png

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
amitchandak
Super User
Super User

@Anonymous , for show hide you might have use bookmark.

https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive

 

There is another option but it replaces the value in existing column

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
nvprasad
Solution Sage
Solution Sage

Hi 

Try below 

 

Showvalue =
SWITCH (
TRUE (),
SELECTEDVALUE ( slicer[column] ) = "Price", [PriceMeasure],
SELECTEDVALUE ( slicer[column] ) = "Percentage", [PercentageMeasure],
BLANK ()
)

 

Thanks,

Venkata Nalla

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

@nvprasad 

I applied the same logic but is returning blank, any idea why ?

Thanks,

mac

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors