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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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