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.
I am creating a new column using the following formula:
Hi, @Swastik79
try this one.
Calculated Column =
VAR Country = SELECTEDVALUE('Country Dimension'[Country])
VAR Plant = SELECTEDVALUE('Plant Dimension'[Plant])
RETURN
SWITCH(
TRUE(),
Country IN {"Country 1", "Country 2", "Country 3"}, "Value 1",
Country = "Country 4", "Value 2",
Country = "Country 5" && Plant IN {"Plant 1", "Plant 2", "Plant 3", "Plant 4"}, "Value 3",
Country = "Country 5" && Plant IN {"Plant 5", "Plant 6", "Plant 7"}, "Value 4",
"Others"
)
make sure to adjust column names.
Proud to be a Super User!
Hi @rubayatyasmin,
On using the above formula when i try to use calculated column as a row in a matrix it only shows "Others" as row. Can you edit the formula such that it displays "Value 1", "Value 2", "Value 3", "Value 4", "Others" as rows?
try this one.
Calculated Column =
VAR Country = SELECTEDVALUE('Country Dimension'[Country])
VAR Plant = SELECTEDVALUE('Plant Dimension'[Plant])
RETURN
SWITCH(
TRUE(),
Country IN {"Country 1", "Country 2", "Country 3"}, "Value 1",
Country = "Country 4", "Value 2",
Country = "Country 5" && Plant IN {"Plant 1", "Plant 2", "Plant 3", "Plant 4"}, "Value 3",
Country = "Country 5" && Plant IN {"Plant 5", "Plant 6", "Plant 7"}, "Value 4",
"Others"
) & "-" & Country
Proud to be a Super User!
Hi @rubayatyasmin,
On using the above formula when i try to use calculated column as a row in a matrix it now only shows "Others-" as row.
a demo data file would be appreciated.
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
44 | |
38 | |
37 |