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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
akemr
Helper II
Helper II

Trying to display the correct # of contracts

Hi all,

 

I have a list of contracts that have a country and a "active/inactive" status assigned to them. I've used a card visual to display the # of active contracts in a country. The measure is as follows: 

 

# Active Contracts = CALCULATE(Counta('Table'[Active/Inactive Contract]), FILTER(ALL('Table'[Active/Inactive Contract]), 'Table'[Active/Inactive Contract] = "Active"))
 
But on selecting a country with 0 active contracts, instead of displaying 0, the card displays (Blanks). I want it to show 0. How do i resolve this?
2 ACCEPTED SOLUTIONS
FarhanAhmed
Community Champion
Community Champion

# Active Contracts = 

IF( ISBLANK(CALCULATE(Counta('Table'[Active/Inactive Contract]), FILTER(ALL('Table'[Active/Inactive Contract]), 'Table'[Active/Inactive Contract] = "Active"))),0,# Active Contracts = CALCULATE(Counta('Table'[Active/Inactive Contract]), FILTER(ALL('Table'[Active/Inactive Contract]), 'Table'[Active/Inactive Contract] = "Active")))






Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




View solution in original post

Fowmy
Super User
Super User

@akemr 

Add +0 at the end of your measure

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@akemr , need some data to check that. But try like

# Active Contracts = CALCULATE(Counta('Table'[Active/Inactive Contract]), FILTER(ALL('Table'[Active/Inactive Contract]), 'Table'[Active/Inactive Contract] = "Active")) +0

and then filter for 0.

 

or use this option

ShowItemwithoutdata.JPG

 

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

Hi all, thank you very much for your help. I marked @FarhanAhmed's reply as the solution but all of your answers are solutions, i think @Fowmy's solution is the simplest to execute. thank you all 🙂

@akemr 

You are welcome!

The forum allows you to mark more than one solution as accepted solutions.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Fowmy
Super User
Super User

@akemr 

Add +0 at the end of your measure

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

FarhanAhmed
Community Champion
Community Champion

# Active Contracts = 

IF( ISBLANK(CALCULATE(Counta('Table'[Active/Inactive Contract]), FILTER(ALL('Table'[Active/Inactive Contract]), 'Table'[Active/Inactive Contract] = "Active"))),0,# Active Contracts = CALCULATE(Counta('Table'[Active/Inactive Contract]), FILTER(ALL('Table'[Active/Inactive Contract]), 'Table'[Active/Inactive Contract] = "Active")))






Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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