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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
ld17
Helper II
Helper II

Showing zero on a line graph using DimDate

I'm trying to create a line graph that shows incident trends by month over the last four years. I have a "year" column , a "month" column, and an "incident" column, but for some months, there is no data, so when I try to put this data into a line graph, I want it to show zero, but it just shows nothing. One solution said to create a DimDate table, so I did this and created a relationship between the DimDate date and my original date, but it still does not plot zero. Any ideas where I might be doing wrong?

1 ACCEPTED SOLUTION

Thank you for this! I had seen a similar solution posted elsewhere, but I had some confusion with which measure I was adding zero to since I don't have any measures already applied to this particular graph.

The solution that ended up working for me was to create a DimDate table and follow the steps and add the code from this site. One change I had to make was to use Date.EndofMonth instead of Date.EndofYear, because I only wanted it to count this year's data up to this month since the remaining months in this year haven't happened yet.

Then I had to create a relationship between the date column in my original table and the date column in the DimDate table. Then I added the following DAX expression to my new table: 

 

COUNT OF INCIDENTS = 

VAR _INCIDENTS = COUNT ('Table name'[Column name]) 

RETURN 

IF (ISBLANK(_INCIDENTS),0,_INCIDENTS)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @ld17 ,

 

Try adding "+0" in your measure or column.

For example,

when there's no "+0".

vstephenmsft_1-1660639545261.png

 

 

When creating a measure to add "+0".

vstephenmsft_2-1660639588907.png

 

 

 

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.

 

 

Thank you for this! I had seen a similar solution posted elsewhere, but I had some confusion with which measure I was adding zero to since I don't have any measures already applied to this particular graph.

The solution that ended up working for me was to create a DimDate table and follow the steps and add the code from this site. One change I had to make was to use Date.EndofMonth instead of Date.EndofYear, because I only wanted it to count this year's data up to this month since the remaining months in this year haven't happened yet.

Then I had to create a relationship between the date column in my original table and the date column in the DimDate table. Then I added the following DAX expression to my new table: 

 

COUNT OF INCIDENTS = 

VAR _INCIDENTS = COUNT ('Table name'[Column name]) 

RETURN 

IF (ISBLANK(_INCIDENTS),0,_INCIDENTS)

Anonymous
Not applicable

Hi @ld17 ,

 

Since you didn't have a measure, are you putting a column or a calculated column?

Then you can create a measure, use the SUM function to get the sum of the fields you want, and then add 0.

For example,

Measure = SUM('Table'[ColumnNmae]) + 0

 

 

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.

ld17
Helper II
Helper II

Here is a screenshot of what is happening to my data:

 

Capture.PNG

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Kudoed Authors