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
dswinden
Helper II
Helper II

Replacing a blank or null value with 0 to show all account records as 1/0

Trying to provide my sales team with a simple 1 or 0 logic tool to show whether a product is listed at an account or not.  Simple explanation, if a sales person has 20 stores that they call on, i want the sales person to see all 20 stores at once, and show 1 or 0 "Listed" or "Not Listed" based on a measure i have pre-written

 

The measure I have written to determine if sales are there or not works fine, but only shows stores with sales.  If is calculating the inventory of a store across a 3 month period, and if the sum is greater than 0, it will return a distinct count of 1 based on the count of the POC (retailer) name.

 

R3M | Listings =
CALCULATE(DISTINCTCOUNTNOBLANK('POC Universe'[POC Name]),filter(distinct('POC Universe'[POC Name]),CALCULATE([R3M | Inventory Level (All Scrapes)])))


I have tried something as simple as =if([R3M | Listings]>0,1,0) but all values return as 0 when this happens.  Below is a simple example of what my data SHOULD look like.
 
dswinden_0-1679065367917.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@dswinden , Try like

Switch(true(),

isblank([R3M | Listings]) , blank() ,

[R3M | Listings]>0,1,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@dswinden , Try like

Switch(true(),

isblank([R3M | Listings]) , blank() ,

[R3M | Listings]>0,1,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak as always!  One of the first to reply to my questions, appreciate it!

 

I tried what you provided but unfortuneately it still does not show the 0's.  I have a suspicion its due to my data structure so I will tinker a bit with it now.  Will get back to you!

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.