Forum Discussion
Using Field Parameters on Columns in matrix
- 1 year ago
Hi katemarkoska28 ,
Please check file attach with the switch statment and a column using the name for each one on the parameter table.,
Hi katemarkoska28 ,
The issue you're experiencing happens because the field parameter doesn't automatically filter based on external slicer selections, like your Group Label. Even if you use a disconnected slicer with the same labels (LastMonth, CurrentMonth), Power BI will still show all parameter values unless you explicitly filter them with a measure. To address this, keep your original field parameter table as it is:
Switch = {
("Number", NAMEOF('Calculations'[ProductionLastMonth]), 0, "LastMonth", 1),
("Value", NAMEOF('Calculations'[ValueProductionLastMonth]), 1, "LastMonth", 1),
("Number", NAMEOF('Calculations'[ProductionCurrentMonth]), 2, "CurrentMonth", 2),
("Value", NAMEOF('Calculations'[ValueProductionCurrentMonth]), 3, "CurrentMonth", 2)
}
Then, create a disconnected table to use in your slicer:
GroupLabelSlicer = DATATABLE("GroupLabel", STRING, {{"LastMonth"}, {"CurrentMonth"}})
Add this table to the slicer. Now, create a filter measure to dynamically match the slicer selection with the group label from your parameter table:
ShowSelectedGroupValues :=
VAR SelectedGroup = SELECTEDVALUE(GroupLabelSlicer[GroupLabel])
VAR ParamGroup = SELECTEDVALUE('Switch'[Group Label])
RETURN
IF(ParamGroup = SelectedGroup || ISBLANK(SelectedGroup), 1, 0)
Finally, drag this measure into the Filters pane of your matrix visual and set it to filter only when the value is 1. This will ensure that only the values from the selected group label (LastMonth or CurrentMonth) are shown in the matrix, and when both are selected, you’ll see only their corresponding parameter values, not all four.
Best regards,
- katemarkoska281 year agoFrequent Visitor
I have tried this solution previously, but doesn't solve the issue.