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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Alicia_Anderson
Resolver I
Resolver I

Show 0 instead of Blank on specific condition

I want to force a zero to display instead of blank when a specific condition occurs.   

 

I have a measure that calculates points Done, which works fine:   

Effort-Done = CALCULATE(SUM('PI_Work'[Effort]), 'PI_Work','PI_Work'[State]="Done")

 

However, if the Sprint is less than the Current Sprint (is in the past) and it shows blank, I want it to return 0 instead.  This is my attempt but it is showing zero for all Sprints and not just those in the past.   

Effort_Done2 = VAR DoneZero = CALCULATE(SUM('PI_Work'[Effort]), 'PI_Work','PI_Work'[State]="Done", FILTER('PI_Work','PI_Work'[Sprint#]<[Current_Sprint#])) RETURN if(DoneZero=Blank(),0,DoneZero)
 
In my example below, the Current Sprint=5
Alicia_Anderson_1-1654873960756.png

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can try

 

Effort done 2 =
var workDone = [Effort-Done]
return IF( SELECTEDVALUE( 'PI_Work'[Sprint#]) < [Current Sprint#], COALESCE(workDone, 0), workDone)

 

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

You can try

 

Effort done 2 =
var workDone = [Effort-Done]
return IF( SELECTEDVALUE( 'PI_Work'[Sprint#]) < [Current Sprint#], COALESCE(workDone, 0), workDone)

 

I get an error with that:  “Too many arguments were passed to the SELECTEDVALUE function.   The maximum argument count for the function is 2.”

Typo, I was missing a ). I've edited the original post.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.