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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
slapdragon
Frequent Visitor

Two lines in a line chart - Stop both when one line stops having data and exclude zero values

This is something I am unable to figure out though I have gone through several posts on here. Need help please!

 

I have two tables. One that contains the solved dates, ticket numbers etc and the other table contains just dates from 2019 till 2021 with the corresponding custom period and week numbers that we follow:

 

slapdragon_0-1595490583049.png

 

I have a line graph where I have data for the total number of tickets solved in both 2019-20 and 2020-21 with two measures that I had created:

Total_Tickets_2019_2020 = CALCULATE([TotalTickets], FILTER(CustomWeek, CustomWeek[CustomYear] = "2019-20")) + 0
and
Total_Tickets_2020_2021 = CALCULATE([TotalTickets], FILTER(CustomWeek, CustomWeek[CustomYear] = "2020-21")) + 0

 

The X-axis a custom week number that we follow which is one of the columns in the above screenshot.

 

slapdragon_0-1595491723086.png

slapdragon_2-1595491796654.png

 

Here's the question:

1. How do I stop the current year from showing zero values past the date where we have no data for. Example - We are currently in Week21 and there is no data for the future dates (obviously), so I dont want it to show the line for the '0s' for the current year,

2. How do I not show last year's data and I would like to stop the last year's line where the data for the current year ends. I dont want the data for weeks past Week21 for the last year. I want it to show only for "this week last year", but this is a custom week number and not a calendar week.

 

Hope this isn't too much of an ask. Thanks in advance 🙂

1 ACCEPTED SOLUTION

Thank you both for the responses. I managed to fix the zero values as I removed the "+ 0" from the TotalTickets measure.

 

I am yet to understand the fix for my 2nd point though. I haven't been able to understand the info from the links specified.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @slapdragon,

I'm not so sure how your total ticket calculated, can you please share some dummy data with your formula to help us clarify your scenario and test coding formula on it?

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you both for the responses. I managed to fix the zero values as I removed the "+ 0" from the TotalTickets measure.

 

I am yet to understand the fix for my 2nd point though. I haven't been able to understand the info from the links specified.

amitchandak
Super User
Super User

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors