cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
akapoor03
Post Partisan
Post Partisan

Replace "Blank" with 0 on card visual

I have these below measures in card visuals. When there is nothing then is shows BLANK, I need 0 instead of BLANK-

 

1) 

Current Closed Orders = var test=VALUE(FORMAT(NOW()+((1/24)*10),"D/MM/YYYY"))
Return
CALCULATE (
COUNT( 'Packing Jobs'[JobID] ),
FILTER ( ALLSELECTED('Packing Jobs'), [Job Close Time(Date format)] =test )
)
 
2) 
Closed in < 48 Hrs = var test=VALUE(FORMAT(NOW()+((1/24)*10),"D/MM/YYYY"))
Return
CALCULATE (
COUNTAX('Packing Jobs',if('Packing Jobs'[Time_Taken(Hrs.)] <= 48, COUNT('Packing Jobs'[JobID]))),
FILTER ( ALLSELECTED('Packing Jobs'), [Job Close Time(Date format)] =test )
)
3)
Current % 48 Hrs = var test=VALUE(FORMAT(NOW()+((1/24)*10),"D/MM/YYYY"))
Return
CALCULATE (
COUNTAX('Packing Jobs',if('Packing Jobs'[Time_Taken(Hrs.)] <= 48, COUNT('Packing Jobs'[JobID]))),
FILTER ( ALLSELECTED('Packing Jobs'), [Job Close Time(Date format)] =test )
)/
CALCULATE (
COUNT( 'Packing Jobs'[JobID] ),
FILTER ( ALLSELECTED('Packing Jobs'), [Job Close Time(Date format)] =test )
)
2 ACCEPTED SOLUTIONS
vivran22
Community Champion
Community Champion

Hello @akapoor03 ,

 

You may add +0 at the end of your formula.

 

This may give you the desired results.

 

Cheers!

Vivek

View solution in original post

TheoC
Community Champion
Community Champion

Hi @akapoor03,

 

One of the ways I like to get around this is by using an IF ( ISBLANK ( .... ) , 0 , ( .... ) ) or IF ( (....) = 0 , 0 , ....  For example:

 

IF ( 

CALCULATE (

COUNT( 'Packing Jobs'[JobID] ),
FILTER ( ALLSELECTED('Packing Jobs'), [Job Close Time(Date format)] =test ) ) = 0 , 0 ,

CALCULATE (

COUNT( 'Packing Jobs'[JobID] ),
FILTER ( ALLSELECTED('Packing Jobs'), [Job Close Time(Date format)] =test ) ) )

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

6 REPLIES 6
TheoC
Community Champion
Community Champion

Hi @akapoor03,

 

One of the ways I like to get around this is by using an IF ( ISBLANK ( .... ) , 0 , ( .... ) ) or IF ( (....) = 0 , 0 , ....  For example:

 

IF ( 

CALCULATE (

COUNT( 'Packing Jobs'[JobID] ),
FILTER ( ALLSELECTED('Packing Jobs'), [Job Close Time(Date format)] =test ) ) = 0 , 0 ,

CALCULATE (

COUNT( 'Packing Jobs'[JobID] ),
FILTER ( ALLSELECTED('Packing Jobs'), [Job Close Time(Date format)] =test ) ) )

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

TheoC
Community Champion
Community Champion

@akapoor03 here is a great article from Radacad on this: https://radacad.com/replace-blank-with-zero-in-power-bi-visuals-such-as-card

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC Thanks a lot

vivran22
Community Champion
Community Champion

Hello @akapoor03 ,

 

You may add +0 at the end of your formula.

 

This may give you the desired results.

 

Cheers!

Vivek

Instated of 0 I need to display the "?" mark. Can you assist for this

@SriLakshmi_46 you can add instead of using IF ( .... = 0 , 0 , .....) you will need to swap the middle 0 with IF ( .... = 0 , "?" , .... ).   However, you can only do this where the column itself is text based and not a Whole Number or Decimal.  Reasonbeing, Text (i.e. "?") is not a numeral and cannot be used in value-based measures, etc.  Hope that makes sense?

 

Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors