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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Argument 30 in Switch function is required

Hi Experts

 

Cannot see what this error message means and how to correct it:

SWITCH(

SELECTEDVALUE('DimP&L'[Item]),

"Gross Sales", SUM('Sales&Ohd_Data_Master'[Gross_Sales_USD])/1000,

"Rebate", CALCULATE(SUM('Sales&Ohd_Data_Master'[Local_Rebates_USD])/1000, REMOVEFILTERS('DimP&L')),

"Stock Cleanse", CALCULATE(SUM('Sales&Ohd_Data_Master'[Stock_Cleanse_USD])/1000, REMOVEFILTERS('DimP&L')),

"Net Sales", CALCULATE(SUM('Sales&Ohd_Data_Master'[Net_Sales_USD])/1000, REMOVEFILTERS('DimP&L')),

"COGS", CALCULATE(SUM('Sales&Ohd_Data_Master'[Gross_Cost_USD])/1000, REMOVEFILTERS('DimP&L')),

"Gross Margin", CALCULATE(SUM('Sales&Ohd_Data_Master'[Factory_Margin_USD])/1000, REMOVEFILTERS('DimP&L')),

"WD", CALCULATE(SUM('Sales&Ohd_Data_Master'[8.SC&L True-up])/1000, REMOVEFILTERS('DimP&L')),

"OCOGS", (CALCULATE(SUM('Sales&Ohd_Data_Master'[9.OCOGS_Direct])/1000)+CALCULATE(SUM('Sales&Ohd_Data_Master'[9.OCOGS_Indirect])/1000, REMOVEFILTERS('DimP&L'))),

"IBG", (CALCULATE(SUM('Sales&Ohd_Data_Master'[11f IBG_Direct])/1000)+CALCULATE(SUM('Sales&Ohd_Data_Master'[11f IBG_Indirect])/1000, REMOVEFILTERS('DimP&L'))),

"Contribution Margin", (CALCULATE(SUM('Sales&Ohd_Data_Master'[Factory_Margin_USD])/1000)-CALCULATE(SUM('Sales&Ohd_Data_Master'[8.SC&L True-up])/1000)-CALCULATE(SUM('Sales&Ohd_Data_Master'[9.OCOGS_Direct])/1000)+CALCULATE(SUM('Sales&Ohd_Data_Master'[9.OCOGS_Indirect])/1000)-CALCULATE(SUM('Sales&Ohd_Data_Master'[11f IBG_Direct])/1000)+CALCULATE(SUM('Sales&Ohd_Data_Master'[11f IBG_Indirect])/1000, REMOVEFILTERS('DimP&L'))),

"Manufacturing & Engineering", (CALCULATE(SUM('Sales&Ohd_Data_Master'[MFG+ENG+OCOGS Direct])/1000)+CALCULATE(SUM('Sales&Ohd_Data_Master'[MFG+ENG+OCOGS Indirect])/1000, REMOVEFILTERS('DimP&L'))),

"SG&A", CALCULATE(SUM('Sales&Ohd_Data_Master'[SG&A Direct])/1000)+CALCULATE(SUM('Sales&Ohd_Data_Master'[SG&A Indirect])/1000, REMOVEFILTERS('DimP&L')),

"D&A", CALCULATE(SUM('Sales&Ohd_Data_Master'[D&A Direct])/1000)+CALCULATE(SUM('Sales&Ohd_Data_Master'[D&A Indirect])/1000, REMOVEFILTERS('DimP&L')),

"OI", CALCULATE(SUM('Sales&Ohd_Data_Master'[OI])/1000, REMOVEFILTERS('DimP&L')),

)

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous In your second to last line, remove the comma or add a default statement like BLANK()



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous In your second to last line, remove the comma or add a default statement like BLANK()



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

thanks. Greg....DOH! on my part,....

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors