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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
mmills2018
Helper IV
Helper IV

Error when changing folder source

Hello,

 

i changed my data source folder and i keep getting the below error, any ideas what this is?

 

Too few arguments were passed to the SWITCH function. The minimum argument count for the function is 3. OLE DB or ODBC error: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)).

3 REPLIES 3
Anonymous
Not applicable

Hi  @mmills2018  ,

 

Check whether the data type of the field has changed after the data source is updated, for example, SUM ('Talent Snapshot'[PME USA Headcount]), the sum can only calculate the numeric type, and if'[PME USA Headcount] becomes Text, there will be a type mismatch.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

selimovd
Super User
Super User

Hey @mmills2018 ,

 

can you post the measure that contains the SWITCH function?

It's a little hard to say where the error happens without any details...

 

Best regards

Denis

pretty much all my measures are using the switch function, below is one of the measures.  I am just confused as to why i would get this when changing the folder source, the data itself did not change

 

 

Associates Nominated to Talent Pool =
var filtered = FILTER('Talent Snapshot','Talent Snapshot'[Count Talent Pool]=1)
VAR cta_add = SUMX ( FILTER (filtered,[Gender] in VALUES ( Gender[Gender]) ), 'Talent Snapshot'[Sum in Talent Pool] )
VAR cta_poc =SUMX ( FILTER (filtered,[Race/Ethnicity] in VALUES ( PoC[PoC (USA Only)] ) ), 'Talent Snapshot'[PME USA Headcount] )
VAR cta_raw =SUMX ( filtered, 'Talent Snapshot'[Sum in Talent Pool])
VAR cta_rawpoc = SUMX(filtered, [PME USA Headcount])
VAR _flagG = ISFILTERED(Gender[Gender])
VAR _flagpoc = ISFILTERED(PoC[PoC (USA Only)])
VAR _round = ROUND (IF (_flagG,MAX ( 0, DIVIDE ( cta_add, cta_raw ) ),DIVIDE ( cta_raw, SUM ( 'Talent Snapshot'[Count of (M4+) Senior Leaders] ) )),2) * 100
VAR _roundpoc = round(IF(_flagpoc, MAX ( 0, DIVIDE ( cta_poc, cta_rawpoc ) ),DIVIDE ( cta_rawpoc, SUM ( 'Talent Snapshot'[PME USA Headcount] ) )),2)*100
VAR _fixed = MAX ( 0, VALUE ( FIXED ( IF ( _flagG, cta_add, cta_raw ), 0 ) ) )
VAR _fixedpoc =MAX ( 0, VALUE ( FIXED ( IF ( _flagpoc, cta_poc, cta_rawpoc ), 0 ) ) )
VAR _round1 = if(_round=BLANK(),0,FIXED(_fixed,0))
VAR _roundpoc1 = if(_roundpoc=BLANK(),0,FIXED(_fixedpoc,0))

RETURN
SWITCH(TRUE(),ISFILTERED(PoC[PoC (USA Only)]),_roundpoc+0 & "% (" &FIXED( _fixedpoc,0) & ")",ISFILTERED(Gender[Gender]),_round+0 & "% (" &FIXED( _fixed,0) & ")",_round+0 & "% (" & FIXED(_fixed,0) & ")")

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.