Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all! I am a novice at DAX and am trying to write an IF statement
Solved! Go to Solution.
@aduguid , finally got it to work using this
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |