Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
Let's say I have products with different possible colors.
I would like to have a pivot table with one color that can be present in different fileds. In the exemple below, I would like to have Green on the row of my pivot table which will sum the sales of Product2, Product4 and Product6.
How do you suggest to proceed?
Thank you
Raphaël
Solved! Go to Solution.
Hi @Raph
Please do the following
Create a filter table containing all colors
Colors =
SELECTCOLUMNS (
FILTER (
DISTINCT (
UNION (
VALUES ( Products[Color1] ),
VALUES ( Products[Color2] ),
VALUES ( Products[Color3] )
)
),
[Color1] <> BLANK ( )
),
"Color", [Color1]
)
Then your measure would be
Number of Products =
VAR SelectedColor = SELECTEDVALUE ( Colors[Color] )
RETURN
COUNTROWS (
FILTER (
Products,
Products[Color1] = SelectedColor
|| Products[Color2] = SelectedColor
|| Products[Color3] = SelectedColor
)
)
Thank you very much !
Hi @Raph
Please do the following
Create a filter table containing all colors
Colors =
SELECTCOLUMNS (
FILTER (
DISTINCT (
UNION (
VALUES ( Products[Color1] ),
VALUES ( Products[Color2] ),
VALUES ( Products[Color3] )
)
),
[Color1] <> BLANK ( )
),
"Color", [Color1]
)
Then your measure would be
Number of Products =
VAR SelectedColor = SELECTEDVALUE ( Colors[Color] )
RETURN
COUNTROWS (
FILTER (
Products,
Products[Color1] = SelectedColor
|| Products[Color2] = SelectedColor
|| Products[Color3] = SelectedColor
)
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
72 | |
38 | |
31 | |
26 |