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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
powerbiexpert22
Impactful Individual
Impactful Individual

Display only related measures or dimensions dynamically in table visual

I have requirement where I need to display columns dynamically in table based on user selection in drop down or slicers

 

example - I have two slicers in my report , one for selecting Dimension and another for selecting Measures  ( created using Field Parameters) 

Table should display Profit Margin measure with Product dimension selected however if user select  Customer or Date dimension with Profit Margin then it should show nothing because Profi Margin is not related with Customer or Date dimenion

10 REPLIES 10
HarishKM
Memorable Member
Memorable Member

@powerbiexpert22 Hey,

I will follow below steps 

  1. I will use below field parameter -

Dimension Field Parameter: Include Product, Customer, and Date dimensions.
Measure Field Parameter: Include Profit Margin and any other relevant measures.

2. I will Configure few Slicers:

Dimension Slicer: Connect the slicer to the Dimension Field Parameter.
Measure Slicer: Connect another slicer to the Measure Field Parameter.

 

3. Use DAX to create a calculated measure that checks the selection:

DisplayMeasure =
IF(
SELECTEDVALUE(DimensionParameter[Value]) = "Product" &&
SELECTEDVALUE(MeasureParameter[Value]) = "Profit Margin",
[Profit Margin],
BLANK()
)

 

I will above mentioned steps to troubleshoot and solve your problem.

 

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
 
v-nmadadi-msft
Community Support
Community Support

Hi @powerbiexpert22 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


Thank you.

powerbiexpert22
Impactful Individual
Impactful Individual

Hi @GrowthNatives ,

i created a sample power bi report with your solution implemented , it is not working expected , please see below file

 

https://drive.google.com/file/d/1ZjwAcSfRHM78ZtFkEGXHz1VrD0rCBVRg/view?usp=drive_link

 

 

Hi @powerbiexpert22 ,
I currently don’t have access to the reference file you mentioned — could you please share a few screenshots showing:

  1. The relationship view (especially for the slicer and mapping tables).
  2. The wrapper measure setup you used.
  3. How the Field Parameter table is connected to the visuals.

That would help me cross-check the structure and setup

In the meanwhile , please check these five common points 

Step 1 – Confirm the slicer table

Go to Data View → DimSelector and confirm it contains only:

Product, CustomerDate

and it has no relationships with any other table.
👉 In Model view, it must stay disconnected


Step 2 – Check your mapping table

Open MeasureDimensionMap in Data View.
It must have exact text matches for the dimension names in the slicer, e.g.

ProfitMargin | Product

Revenue | Product
Revenue | Customer
OrderCount | Customer
Revenue | Date

If the spelling or spacing differs from DimSelector[Dimension], the comparison fails and the wrapper will always return BLANK().


Step 3 – Check your wrapper measure logic

Use exactly this pattern (adjust only measure name):




Display_ProfitMargin = VAR selDim = SELECTEDVALUE(DimSelector[Dimension]) VAR allowed = COUNTROWS( FILTER( MeasureDimensionMap, MeasureDimensionMap[MeasureKey] = "ProfitMargin" && MeasureDimensionMap[Dimension] = selDim ) ) > 0 RETURN IF( allowed || ISBLANK(selDim), [Profit Margin], BLANK() )

Tip:
Add a temporary Card visual with selDim = SELECTEDVALUE(DimSelector[Dimension]) just to confirm it returns the slicer’s text (“Product”, “Customer”…).
If it’s blank even after you select something, the slicer is from a different table or disconnected incorrectly.


Step 4 – Use the wrapper in the Field Parameter

Open your Field Parameter table in Data View (it’s the auto-generated parameter table).
Ensure it references Display_ProfitMargin — not [Profit Margin].
If your slicer is still tied to the old field parameter that points to base measures, the wrappers never execute.


Step 5 – Test logic interactively

  • Select Product in the slicer → you should see values.

  • Select Customer or Date → cells go blank.

If still wrong:

  1. Create a test measure:

     
    Debug_Check =
    "selDim=" & SELECTEDVALUE(DimSelector[Dimension]) &
    " | allowed=" &
    IF(
        COUNTROWS(
            FILTER(
                MeasureDimensionMap,
                MeasureDimensionMap[MeasureKey] = "ProfitMargin"
                    && MeasureDimensionMap[Dimension] = SELECTEDVALUE(DimSelector[Dimension])
            )
        ) > 0,
        "TRUE","FALSE"
    )
  2. Drop it in a card and read the text after slicer changes.




Hi @GrowthNatives ,

 

Please see below screenhsots

 

powerbiexpert22_0-1759924541623.png

 

powerbiexpert22_1-1759924565559.pngpowerbiexpert22_2-1759924586569.pngpowerbiexpert22_3-1759924602633.pngpowerbiexpert22_4-1759924645435.png

powerbiexpert22_6-1759924760959.pngpowerbiexpert22_7-1759924798083.pngpowerbiexpert22_8-1759924894259.pngpowerbiexpert22_9-1759924913987.pngpowerbiexpert22_10-1759924961608.png

 

 

Hi @powerbiexpert22 ,
Initially you have mentioned this
"If user select  Customer or Date dimension with Profit Margin then it should show nothing because Profi Margin is not related with Customer or Date dimenion"
as per the screenshots you have shared and with the .pbix you have shared the table does not

vnmadadimsft_0-1760277935187.png

 

show any values when the combination of slicer options are selected, isn't this your requirement? Please clarify so that we can try to configure the .pbix as per your needs.

 


Thank you


Praful_Potphode
Resolver II
Resolver II

Hi @powerbiexpert22 ,

You can create a flag measure to control the measure slicer like below

Flag = IF(
    SELECTEDVALUE('Dimensions'[Dimensions Fields])="'Orders'[Order Date]" 
    && SELECTEDVALUE('Measures 2'[Measures Fields])="'Orders'[profit margin]",1,0
)

add this to your measure slicer and add condition Flag is 0.this will not show profit margin when

date is selected(as an example).

 

Please mark it as resolved once confirmed.

 

Thanks and Regards,

Praful

 

Hi @Praful_Potphode , this solution is not appropriate considering we have more combination of dimensions and measures so permutation and combination become very large and complex and it will be very complicated DAX expression

GrowthNatives
Continued Contributor
Continued Contributor

Hi @powerbiexpert22  ,
I get that you want to display only related measures or dimensions dynamically

Idea

Create a lightweight dimension selector and a measure↔dimension mapping table, then expose every report measure through a small wrapper measure that returns the real value only when the selected dimension is valid; otherwise it returns BLANK().

Steps

1. Create a disconnected slicer for Dimension selection

DimSelector = DATATABLE(
  "Dimension", STRING,
  { {"Product"}, {"Customer"}, {"Date"} }
)

Use DimSelector[Dimension] as the slicer users pick.

2. Create a mapping table (which measures are valid for which dims)

MeasureDimensionMap = DATATABLE(
  "MeasureKey", STRING,
  "Dimension", STRING,
  {
    {"ProfitMargin","Product"},
    {"Revenue","Product"},
    {"Revenue","Customer"},
    {"OrderCount","Customer"},
    {"Revenue","Date"}
  }
)


3. Create a wrapper measure for each business measure

Display_ProfitMargin =
VAR selDim = SELECTEDVALUE( DimSelector[Dimension] )
VAR allowed =
    COUNTROWS(
      FILTER(
        MeasureDimensionMap,
        MeasureDimensionMap[MeasureKey] = "ProfitMargin" &&
        MeasureDimensionMap[Dimension] = selDim
      )
    ) > 0
// If no dimension selected, you may choose to show or hide; below shows when selDim blank
RETURN
IF( selDim = BLANK() || allowed, [Profit Margin], BLANK() )

Put Display_ProfitMargin (not the raw measure) into your Measure field-parameter or table values.

4. Wire wrappers into the Measure Field Parameter
If you already use a Field Parameter that controls which measures appear, replace the entries for measures with their wrapper measures. That way the field parameter continues to control visibility, but content is conditional on the selected dimension.

5. User experience / visuals

When the user selects Product the Display_ProfitMargin returns real values.

When they select Customer or Date, the wrapper returns BLANK() → table shows empty cells (effectively “nothing”).

If you want the entire column removed instead of blank cells, you’d need to remove the measure from the parameter dynamically (not natively supported) or use a calculation-group / Tabular Editor approach (advanced).
Optional advanced: hide entire column

- If blanks are not good enough and you must remove the column from view, consider:

- A calculation group with SELECTEDMEASURE() logic (Tabular Editor), or

- Programmatic parameter rebuild (Power Query / JSON) — both are advanced and require model-editing tools.

Quick checklist before you finish

  • Ensure your wrappers are used everywhere the measure is presented (Parameter, Cards, tooltips).
  • Test multi-select on DimSelector — the wrapper logic counts a match per selected dimension (adjust logic if you need ANY vs ALL).
  • If the matrix shows headers for blank columns and you want them less visible, apply conditional formatting (font color/opacity) to reduce visual noise.



    Hope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
    💡Found it helpful? Show some love with kudos 👍 as your support keeps our community thriving!
    🚀Let’s keep building smarter, data-driven solutions together!🚀 [Explore More]

 

Hi @GrowthNatives ,

I am able to make it working based on your solution however it is displaying blank values for those measures which are not related with selected dimensions, is there a way to hide those measures? 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.