Page 1 of 1

Using Parameters in IF-THEN-ELSE statements in PBI

Posted: Sat Feb 17, 2018 7:06 am
by gs0706
I'm trying to figure out how to incorporate a parameter inside an IF-THEN-ELSE statement in PBI in order to 'calculate' different outcomes for specific times of the year (monthly, YTD and EOY). See current code (not in PBI obviously) below:

Target Energy Month=
IF (REPORT_MONTH EQ &REPORT_MONTH AND REPORT_YEAR EQ &REPORT_YEAR )
THEN TargetMonthlyTotalEnergy ELSE 0;

Target Energy YTD/=IF (REPORT_MONTH LE &REPORT_MONTH AND REPORT_YEAR EQ &REPORT_YEAR )
THEN TargetMonthlyTotalEnergy ELSE 0;

Target Energy EOY=IF (REPORT_YEAR EQ &REPORT_YEAR )
THEN TargetMonthlyTotalEnergy ELSE 0;

I've looked at various places on the web but I can't find anything specific to my need utilizing parameters. Also I'm not positive this should be an IF-THEN-ELSE statement? Maybe an 'IF-AND' - IF(AND([REPORT_MONTH] = ? Do I need to create parameters? I'm completely at a loss here.

This is my first blog EVER so please forgive me if I'm made any blatant rookie errors.