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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
MPC
Regular Visitor

How to replace the blank with zero in Matrix visual

Hi Team,
@amitchandak 
I have a dataset like below.

MPC_0-1688470091200.png

For the above data I have to show Percentages.

MPC_1-1688470143756.png

Requirement Is : there is no data for some zones, instead of Blank I have to show 0%.

DAX I have written is a as follows:

Percentage of project =
var a= CALCULATE(COUNT(Sheet2[Project]))
var b=CALCULATE(COUNT(Sheet2[Project]),ALL(Sheet2[Zone]))
return
IF((a/b)=BLANK(),0,(a/b) )+0
 
Please check and suggest me a suitable answer.
3 REPLIES 3
Anonymous
Not applicable

Hi @MPC,

If these blank part records include in your table, you can simply use 'replace value' function on 'query editor' side to replace null values to zero to achieve your requirement.
If this blank mean not existed match values, you may need to create an unconnected table with all correspond category and use on matrix. Then you can write a measure formula to check the current row and column value to lookup raw table records and add +0 after the expression to handle not existed parts to zero.
Regards,

Xiaoxin Sheng

This only not working 

Percentage of project =
var a= COUNT(Sheet2[Project])
var b=CALCULATE(COUNT(Sheet2[Project]),ALL('Table'[Zone]))
var c=a/b
var d=SELECTEDVALUE(Sheet2[Zone])
return
IF(ISNONTEXT(d),0,c)+0
Result:
MPC_0-1688620850222.png

 

Anonymous
Not applicable

Hi @MPC,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors