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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.