Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello! I am fairly new to Power BI and I have seen questions similar to mine but the answers aren't working to solve my issue. I have the following SWITCH statement
Solved! Go to Solution.
Unfortunately it is still throwing the same error.
@MBWATSON
Ok must be my mistake. Please try
ROLE =
VAR ChangedBy = '_VIB Report 2022 08 07'[STATUS CHANGED BY]
VAR Department = '_VIB Report 2022 08 07'[DEPARTMENT]
RETURN
SWITCH (
TRUE (),
ChangedBy = "DYER, HEIDI S"
&& Department = "WILSONVILLE", "PCP",
ChangedBy = "MINGS, JENNIFER"
&& Department = "TANASBOURNE", "PCP",
ChangedBy = "HOJNACKI, LAUREN A"
&& Department = "GLISAN", "PCP",
"VIB"
)
Hi @MBWATSON
Please try
ROLE =
SWITCH (
VAR ChangedBy = '_VIB Report 2022 08 07'[STATUS CHANGED BY]
VAR Department = '_VIB Report 2022 08 07'[DEPARTMENT]
RETURN
TRUE (),
ChangedBy = "DYER, HEIDI S"
&& Department = "WILSONVILLE", "PCP",
ChangedBy = "MINGS, JENNIFER"
&& Department = "TANASBOURNE", "PCP",
ChangedBy = "HOJNACKI, LAUREN A"
&& Department = "GLISAN", "PCP",
"VIB"
)
Now I am getting this error message
Failed to resolve name 'ChangedBy'. It is not a valid table, variable, or function name.
@MBWATSON
Strange that this is a key word. However, try
ROLE =
SWITCH (
VAR _ChangedBy = '_VIB Report 2022 08 07'[STATUS CHANGED BY]
VAR _Department = '_VIB Report 2022 08 07'[DEPARTMENT]
RETURN
TRUE (),
_ChangedBy = "DYER, HEIDI S"
&& _Department = "WILSONVILLE", "PCP",
_ChangedBy = "MINGS, JENNIFER"
&& _Department = "TANASBOURNE", "PCP",
_ChangedBy = "HOJNACKI, LAUREN A"
&& _Department = "GLISAN", "PCP",
"VIB"
Unfortunately it is still throwing the same error.
@MBWATSON
Ok must be my mistake. Please try
ROLE =
VAR ChangedBy = '_VIB Report 2022 08 07'[STATUS CHANGED BY]
VAR Department = '_VIB Report 2022 08 07'[DEPARTMENT]
RETURN
SWITCH (
TRUE (),
ChangedBy = "DYER, HEIDI S"
&& Department = "WILSONVILLE", "PCP",
ChangedBy = "MINGS, JENNIFER"
&& Department = "TANASBOURNE", "PCP",
ChangedBy = "HOJNACKI, LAUREN A"
&& Department = "GLISAN", "PCP",
"VIB"
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
69 | |
55 | |
37 | |
35 |
User | Count |
---|---|
85 | |
66 | |
59 | |
46 | |
45 |