Hi - Attempting to follow along in the book and I am having trouble with the Switch function.
House Ownership = SWITCH(
'customers'[HouseOwnershipFlag],1, "owns their own house",0,"Doesn't own their own house", "unknown")
Intellisense isn't recognizing the "Customer[HouseOwnerFlag] column. (Or any of the other columns in that table)
Can anyone suggest why that might be? Thanks
Rich
Switch Function page 78
Re: Switch Function page 78
The formula is
House Ownership =
SWITCH(Customers[HouseOwnerFlag],
1,"Owns their house",
0,"Doesn't own their house",
"Unknown"
)
Please check that there are no typos in the formula.
Intellisense cannot point out typos
House Ownership =
SWITCH(Customers[HouseOwnerFlag],
1,"Owns their house",
0,"Doesn't own their house",
"Unknown"
)
Please check that there are no typos in the formula.
Intellisense cannot point out typos
Ramana Varanasi
Training and Office Manager
Excelerator BI Pty. Ltd.
Training and Office Manager
Excelerator BI Pty. Ltd.
Re: Switch Function page 78
Thanks Ramana for the reply. Intellesense still isn't seeing it.
I am only given options in Intellesense that are measures. Does Switch only work with Measures? Sorry for the Newbie questions
I am only given options in Intellesense that are measures. Does Switch only work with Measures? Sorry for the Newbie questions
Re: Switch Function page 78
Silly me - I was trying to create a measure when I should have been creating a calculated column.
Re: Switch Function page 78
SWITCH function works for both measures and calculated columns.
The above example is for a calculated column using SWITCH function.
Here is an example of SWITCH function for a measure: (Chapter 17, Section Here’s How: Creating a Morphing Switch Measure
Measure to Display =
SWITCH([Selected Measure],
1,[Total Sales],
2,[Total Cost],
3,[Total Margin $]
)
The above example is for a calculated column using SWITCH function.
Here is an example of SWITCH function for a measure: (Chapter 17, Section Here’s How: Creating a Morphing Switch Measure
Measure to Display =
SWITCH([Selected Measure],
1,[Total Sales],
2,[Total Cost],
3,[Total Margin $]
)
Ramana Varanasi
Training and Office Manager
Excelerator BI Pty. Ltd.
Training and Office Manager
Excelerator BI Pty. Ltd.
Re: Switch Function page 78
Excellent! I am still on chapter 13, so I shall learn that soon.
Thanks again
Thanks again
Return to “Help with the Book "Supercharge Power BI"”
Who is online
Users browsing this forum: No registered users and 0 guests


