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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to replace blank values by zero in matrix

I have one column amount. and i am adding measure sum(amount) in matrix. but for some row column combination it is displaying blank so i want to replace those blank with zeros.

I tried measure

measure=sum(amount)

final amount=if(isblank(measure),0,measure)

 

but it is unnecessarily displaying columns which has no data. is there any way so that we will have those columns only which has valid data and replace blank with zeros.matrix.PNG 

4 REPLIES 4
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Try 

 SUM( table[amount] ) + 0

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski



Anonymous
Not applicable

adding zero in measure also leads to same result which i have shared. i want same functionality of power BI matrix visula which don't show unnecessary columns even if they are in range.

I want to remove those columns has total 0(if i have not replaced blank with zeros i am getting expect result but our clients want zero instead of blanks).

Hi @Anonymous 

 

Try something like...

IF(  
    CALCULATE( COUNTROWS( YourTable ), ALLEXCEPT( YourTable, 'DateTable' ) ) > 0,
    [YourMeasure] + 0
) 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski



Anonymous
Not applicable

above measure is syntactically wrong.

 

i have modified it

total = IF( 
    CALCULATE( COUNTROWS('Fact Claim Lag Aggregate'), ALLEXCEPT('Lag Aggregate Paid Date','Lag Aggregate Paid Date'[Lag Aggregate Paid Date] ) ) > 0,
    ([Lag Aggregate Total Paid Original Amount] + 0),[Lag Aggregate Total Paid Original Amount]
)
 
please check and let me know, is it as per your logic?
 
 
Fact lag table
lag key
paid date key
service date key
original amount
 
 
lag aggregate paid date(dimension)
paid date key
paid date
month year
 
service date(dimention)
service date key
service date
month year
 
both dimention are connected with fact

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.