Forum Discussion

somulaj's avatar
somulaj
Regular Visitor
5 years ago
Solved

forcing zeros to draw a continuous line

Hi,   I have Date and Sales columns in the database. I would like to see how my sales are changing by month using a line graph. There is no entry for April 2020 in the database. So in my line grap...
  • v-robertq-msft's avatar
    5 years ago

    Hi, somulaj 

    According to your description, I can understand your problem, I think you can solve this problem using a calendar table and a measure, you can follow my steps:

    This is my test data:

     

    1. Create a calendar table a calculated column in the table:
    Date = CALENDAR(DATE(2021,1,1),DATE(2021,8,31))
    Year month = YEAR([Date])&"-"&MONTH([Date])

    Then give them a relationship with the date column:

     

    1. Create a measure in the main table:
    Sales value =
    
    var _sum=SUM('Table'[Sales])
    
    return
    
    IF(_sum=BLANK(),0,_sum)
    1. Create a line chart and place it like this:

     

    And you can get what you want.

    You can download my test pbix file below

     

    If you still have a problem, you can post some sample data(without sensitive data) and your expected result.

    How to Get Your Question Answered Quickly 

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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