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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply

undefined

Show and hide  measures dynamically in a visual based on users solution 

Table : product table 

Column name : amount ,sales,units sold.  Slicer : amount ,sales , units sold .If I click particular column name in slicer ,only filter particular column other column need not be visible 

 

 

 

 

 

 

1 REPLY 1
rubayatyasmin
Community Champion
Community Champion

Hi, @Karthikgayathri 

 

You can use a combination of slicers and the SILECTEDVALUE function. for example. 

 

 

Firstly, you need to create a table with the names of the measures you want to show and hide. This can be done in the Modeling tab, under "New Table". The DAX formula might look something like this:

 

MeasureTable = DATATABLE ( "Measure", STRING, { {"Amount"}, {"Sales"}, {"Units Sold"} } )
 

Then, create a slicer using this table. This will allow your users to select which measure they want to see.

Next, create a new measure which uses the selected value from the slicer to decide which measure to show. This might look something like:

 

Selected Measure = SWITCH ( SELECTEDVALUE ( MeasureTable[Measure] ), "Amount", SUM ( productTable[amount] ), "Sales", SUM ( productTable[sales] ), "Units Sold", SUM ( productTable[unitsSold] ) )

Now, if you create a visual using this new measure, it will show the value of the measure selected in the slicer, and hide the other measures.

 

rubayatyasmin_0-1689517080227.png

 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors