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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JoeX
Frequent Visitor

Line Chart unable to display 0 for blank values

Hi there,

 

I'm running into a problem where the line chart is not showing 0 values when blank, even though I use a DAX to display 0 in such case. 

 

 

Measure = IF(
    ISBLANK(
        DISTINCTCOUNT([ID])
    ),0,DISTINCTCOUNT([ID])
    )

 

 

JoeX_0-1700524075963.png

 

In this scenario the date is from the same table. 

 

However when I use the date field from another table, the 0 does get shown. That table is a calendar table with dates and it has an active relationship to the data table.

JoeX_1-1700524482799.png

 

How can I get the first example to show the 0 on the chart by using the date field in the same table? I'm required to use that date field due to another DAX being dependant on it.  

 

 

2 REPLIES 2
edhans
Super User
Super User

use DISTINCTCOUNTNOBLANK() to get that result. DISTINCTCOUNT only returns a blank when there are no rows to count. If there are rows but they are null/blank, DISTINCTCOUNT will count them. 

 

If that doesn't help, provide info per below. Otherwise we are guessing as to your model layout, the data, etc.

 

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
JoeX
Frequent Visitor

Thanks. Tried DISTINCTCOUNTNOBLANK() and it didn't work. As for the visual I have filters applied which is what creates the blank values.

 

Here's what the relationship looks like:

JoeX_1-1700534278600.png

 

JoeX_0-1700534218322.png

 

Unfortunately I'm not able to upload a sample pbix. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.