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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Is Blank DAX

Hi,

I've below DAX but I'm not getting continues line on visual. How to input 0 if my values are blank/missing.

 

I"m doing Count of ID from CM table with filtered by Not Overdue from [Overdue / Not overdue] column.

 

My Current DAX: 

CALCULATE(count(CM[ID]),CM[Overdue / Not overdue]="Not Overdue") / CALCULATE((COUNT(CM[ID])))
1 ACCEPTED SOLUTION
Anonymous
Not applicable

This one fixed my problem.

% Completion = if(ISBLANK([NotOverDue])&& NOT(ISBLANK([Overdue_CM])),0,
CALCULATE(COUNT(CM[ID]),CM[Overdue / Not overdue]="Not Overdue")/CALCULATE((COUNT(CM[ID]))))

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

This one fixed my problem.

% Completion = if(ISBLANK([NotOverDue])&& NOT(ISBLANK([Overdue_CM])),0,
CALCULATE(COUNT(CM[ID]),CM[Overdue / Not overdue]="Not Overdue")/CALCULATE((COUNT(CM[ID]))))
Anonymous
Not applicable

Hi, The below screenshot explains my issue. For some of my NoOverdue has no values which results blank Percentage values. which is why I'm not getting continues line graph. 

Sorry for the delayed respose. Many thanks

MuraliPrasathS_0-1610200960381.png

I get error when I try to create a variable with return function.

MuraliPrasathS_1-1610201192424.png

 

 

v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


Best Regards,
Stephen Tao

v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

It is suggested to use DIVIDE function. The DIVIDE function was designed to automatically handle division by zero cases. If an alternate result is not passed in, and the denominator is zero or BLANK, the function returns BLANK. When an alternate result is passed in, it's returned instead of BLANK.

 

Try this:

VAR tt =
DIVIDE (
CALCULATE ( COUNT ( CM[ID] ), CM[Overdue / Not overdue] = "Not Overdue" ),
CALCULATE ( ( COUNT ( CM[ID] ) ) )
)
RETURN
IF ( ISBLANK ( tt ), 0, tt )

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Try like

divide(CALCULATE(count(CM[ID]),CM[Overdue / Not overdue]="Not Overdue") , CALCULATE((COUNT(CM[ID]))),0)

 

Or

divide(CALCULATE(count(CM[ID]),CM[Overdue / Not overdue]="Not Overdue") , CALCULATE((COUNT(CM[ID]))),0) +0

Anonymous
Not applicable

Hi,

Both approachs are not working.

1st one had no changes

2nd one all value remains zero. any other help?

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

AllisonKennedy
Super User
Super User

@Anonymous  You can always just add 0 to the measure, but this will impact how it behaves with filters and will show 0 for any scenario where values are blank/missing (which is what you asked) but if you want to apply other filters, just come back with more info and we can help.

 

My Current DAX: 

CALCULATE(count(CM[ID]),CM[Overdue / Not overdue]="Not Overdue") / CALCULATE((COUNT(CM[ID]))) + 0

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.