- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Measure using switch giving error on visual
Please can someone help with the following. I have a measure:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thank you for taking the time to look at the issue. I now have a solution for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thank you for taking the time to look at the issue. I now have a solution for this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @gill_thornton ,
The error message you’re seeing indicates that the function in your measure is returning a value of type text instead of a value of type true/false. This is because the last argument of your function is the text string , which is not a valid value for a true/false expression.
ontext = SWITCH(TRUE(),
SELECTEDVALUE(Context[Gender])="M","Boys",
SELECTEDVALUE(Context[Gender])="F","Girls",
SELECTEDVALUE(Context[EAL]) = "Unknown","Unclassified EAL",
SELECTEDVALUE(Context[EAL]) = "No","English",
SELECTEDVALUE(Context[EAL]) = "Yes","Other than English",
SELECTEDVALUE(Context[Ethnicity])="Any other Asian background","Asian - Any other Asian background",
SELECTEDVALUE(Context[Ethnicity])="Any other Black background","Black - Any other Black background",
SELECTEDVALUE(Context[Ethnicity])="Any other ethnic group","Other - Any other ethnic group",
SELECTEDVALUE(Context[Ethnicity])="Any other mixed background","Mixed - Any other mixed background",
SELECTEDVALUE(Context[Ethnicity])="Any other White background","White - Any other White background",
SELECTEDVALUE(Context[Ethnicity])="Bangladeshi","Asian - Bangladeshi",
SELECTEDVALUE(Context[Ethnicity])="Black African","Black - Black African",
SELECTEDVALUE(Context[Ethnicity])="Black Caribbean","Black - Caribbean",
SELECTEDVALUE(Context[Ethnicity])="Chinese","Chinese Total",
SELECTEDVALUE(Context[Ethnicity])="Indian","Asian - Indian",
SELECTEDVALUE(Context[Ethnicity])="Information Not Yet Obtained","Unclassified - Total",
SELECTEDVALUE(Context[Ethnicity])="Pakistani","Asian - Pakistani",
SELECTEDVALUE(Context[Ethnicity])="Refused","Unclassified - Total",
SELECTEDVALUE(Context[Ethnicity])="Traveller of Irish heritage","White - Traveller of Irish heritage",
SELECTEDVALUE(Context[Ethnicity])="White - British","White - White British",
TRUE())
SWITCH function (DAX) - DAX | Microsoft Learn
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thank you. The national data supplied by the department of education doesn't quite match the context data for our school population. In the national data there is a value under characteristics of total. I don't have such a value in my context table. However, I need total to be shown as "All students".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @gill_thornton
Dont take measure try to take calculated columnfr this type of calculation.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
Anonymous
| 10-07-2022 02:14 AM | ||
05-04-2024 12:22 AM | |||
04-09-2022 04:16 AM | |||
09-12-2023 03:56 AM | |||
Anonymous
| 11-28-2021 07:29 PM |
User | Count |
---|---|
123 | |
104 | |
84 | |
49 | |
46 |