cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
maiios
Frequent Visitor

Fill in missing values in a line graph with 0, while respecting the slicer

I have looked at other solutions on this forum, but have not found anything that solves my issue. I have some data that has dates with no entry. When I graph it on a line graph, it looks like this:

maiios_1-1637102206020.png

 

I have been trying to get those disconnected points to be connected, with the missing data being graphed as 0. But if I use the following measure, then my graph looks like this:

 

expenses_speed_ = if(isblank([expenses_speed (ATS)]), 0, [expenses_speed (ATS)])

 

maiios_0-1637102061569.png

 

I have the (i think) proper relationships setup between my date table and the table with this data. How do I get my points to be connected while not having my graphs going back to January 1900?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@maiios , because handle null will bring in all duration, I usually handle if again ''example

 

0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

View solution in original post

2 REPLIES 2
maiios
Frequent Visitor

Thank you very much. I have been messing with this for so long... thanks for showing me how to use the min/max to solve this!

amitchandak
Super User
Super User

@maiios , because handle null will bring in all duration, I usually handle if again ''example

 

0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors