cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Sean-OReilly
Helper IV
Helper IV

Need help re Switch

Hi

Im trying to add a Column using Switch Function and when i use the below formula i get blank cells only.

What is wrong with it?

 

Resource No = SWITCH(true(), MK_Job_LedgerEntries[Type] = "Resource", MK_Job_LedgerEntries[No])
 
MK_Job_LedgerEntries[Type] only has 2 results which are "G/L Account" and "Resource" and it is a Text field.
 
1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

Is this in the table 'MK_Job_LedgerEntries'? As this is effectively single condition you could use IF

Resource No = IF(MK_Job_LedgerEntries[Type] = "Resource", MK_Job_LedgerEntries[No])

If it's in a different table then most likely you need to use RELATED on the column references

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Stachu
Community Champion
Community Champion

Is this in the table 'MK_Job_LedgerEntries'? As this is effectively single condition you could use IF

Resource No = IF(MK_Job_LedgerEntries[Type] = "Resource", MK_Job_LedgerEntries[No])

If it's in a different table then most likely you need to use RELATED on the column references

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Proud to be a Super User!

thanks @Stachu i got it to work

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors