Ever built a Power BI report and thought, “This column is useful for some people… but probably noise for others”? I ran into this exact situation while working on an Item Sales Quantity report. The core view broke sales qty down by month, but I also wanted to give users the option to see extra metrics like Year-over-Year Change with % Growth without cluttering the matrix for everyone else.

Luckily, Power BI has a slick way to solve this: Field Parameters. Here is how to do it.

1. First, create Your Measures

Make sure you’ve already built your key measures. In my case, these were:

Total Quantity = SUM('ItemLedgerEntries'[Quantity]
YoY Quantity = 
CALCULATE(
    [Total Quantity],
    SAMEPERIODLASTYEAR('DateTable'[Date])
)
YoY Growth % = 
DIVIDE([Total Quantity] - [YoY Quantity], [YoY Quantity])

2. Create a Field Parameter

Go to the Modeling tab → New Parameter → Fields.


Give it a meaningful name and choose the fields (measures) you want users to optionally see:

  • Total Qty
  • YoY Quantity
  • YoY Growth %

Power BI will create a new table and a slicer for you (if you check the box!!). The DAX behind it looks something like:

YoY Data = {
    ("YoY Growth %", NAMEOF('ItemLedgerEntries'[YoY Growth %]), 0),
    ("YoY Quantity", NAMEOF('ItemLedgerEntries'[YoY Quantity]), 1),
    ("Total Quantity", NAMEOF('ItemLedgerEntries'[Total Quantity]), 2)

This new parameter table will also appear in your Data pane.


3. Build the Slicer

If you did not hit the “add Slicer to this page” button when creating the parameter, you can create a new slicer. Drag the new table/ field onto your canvas as a slicer.


4. Update Your Matrix

Remove the manually-added measures from your matrix’s Values field well. Instead, add the new Parameter tables fields.

Now the matrix will only show columns based on what the user selects in the slicer.

  • If they choose just Sales Qty, it’s clean and simple.
  • If they toggle on YoY Change % or YoY Quantity, the column appears dynamically—not just blanked out.

A special thanks to the Fabric Community for help on this! Through various form searches this was a beautifully constructed solution. Big thanks to DataNinja777!

Would you use this?

Leave a Reply

Trending

Discover more from Not a Pickle

Subscribe now to keep reading and get access to the full archive.

Continue reading