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
MBWATSON
Helper II
Helper II

DAX statement that uses a formula for TRUE and 0 for False returning error

Hi all! I am a novice at DAX and am trying to write an IF statement 

 

SLOTS TO REACH 92% = Name of Measure
CALCULATE(IF('FILL RATE QUERY'[% FILLED] <.92), Expression
(.92 - 'FILL RATE QUERY'[% FILLED]) * ('FILL RATE QUERY'[CONTRACT HOURS] /2), If TRUE
0) If FALSE
 
%Filled is a measure. Contract Hours is a column I created in Power Query.
I am getting this error message
 
Too few arguments were passed to the IF function. The minimum argument count for the function is 2.
 
Hoping for some help to figure out what is missing/wrong. Thanks in advance!
 
1 ACCEPTED SOLUTION

@aduguid , finally got it to work using this

SLOTS TO REACH 92% =

CALCULATE(
IF('FILL RATE QUERY'[% FILLED] <.92

,(.92 - 'FILL RATE QUERY'[% FILLED]) * (DIVIDE(MIN('FILL RATE QUERY'[CONTRACT HOURS]),2)))

)

View solution in original post

3 REPLIES 3
aduguid
Super User
Super User

You just had an end ")" after the .92

 

SLOTS TO REACH 92% =
CALCULATE(
		IF('FILL RATE QUERY'[% FILLED] < 0.92
		, (0.92 - 'FILL RATE QUERY'[% FILLED]) * (DIVIDE('FILL RATE QUERY'[CONTRACT HOURS], 2, 0) )
		, 0
		)
	)

 

I would also suggest either storing the percent as a measure or variable.

SLOTS TO REACH 92% =
VAR _percent_reach = 0.92
VAR _result = 
	CALCULATE(
			IF('FILL RATE QUERY'[% FILLED] < _percent_reach
			, (_percent_reach - 'FILL RATE QUERY'[% FILLED]) * (DIVIDE('FILL RATE QUERY'[CONTRACT HOURS], 2, 0) )
			, 0
			)
		)
		
RETURN
_result

 

@aduguid Thank you for the quick response! When I try to use either of these "FILL RATE QUERY' [CONTRACT HOURS] is no longer an option and I get an error message when I try to use it. Any suggestions?

@aduguid , finally got it to work using this

SLOTS TO REACH 92% =

CALCULATE(
IF('FILL RATE QUERY'[% FILLED] <.92

,(.92 - 'FILL RATE QUERY'[% FILLED]) * (DIVIDE(MIN('FILL RATE QUERY'[CONTRACT HOURS]),2)))

)

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.