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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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
Most Valuable Professional
Most Valuable Professional

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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.