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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.