Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dskeane
Helper I
Helper I

Switch Function Issues

Using connection to a power bi service and running into an issue. 

 

Table reporting month contains 1,2,3,4,5,6,7,8,9,10,11,12. 

 

When I write the SWITCH below it doesnt find the table? Not sure what the issue is?

 

Short Month = SWITCH ('ProjectMetrics'[reportingMonth],
1, "Jan",
2, "Feb",
3, "Mar",
4, "Apr",
5, "May",
6, "Jun",
7, "Jul",
8, "Aug",
9, "Sep",
10, "Oct",
11, "Nov",
12, "Dec",
BLANK ()
)

5 REPLIES 5
KHorseman
Community Champion
Community Champion

What do you mean "it doesn't find the table?"





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




The best way I can explain is with a screen shot. It does not recognize the table even though it exists in the database. 

 

 

Capture.PNG

What error message is it giving you below that? Are you adding this as a column or a measure?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I am seeting this up as a measure. Below is the error message when I drag the Short Month measure on the blan canvas. 

 

Capture.PNG

Well it looks to me like the table is named "(green blur)_Project_ProjectMetrics" not "ProjectMetrics" but even then you can't refer to a naked column in a measure like that. You have to aggregate it somehow inside that switch. Probably using FIRSTNONBLANK is the best way.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.