Forum Discussion

paris's avatar
paris
Helper V
5 years ago
Solved

Create graph by start , end date

Hi All,

 

I like to create a graph by start and end date. 

I have a list of maintenance data and would like to create the graph shown below. Is it doable at Power BI, if so, how can I do?

 

 

All the best,

Paris

  • paris's avatar
    paris
    5 years ago

    Hello Jihwan Kim

    Thank you so much for your reply. I am sorry for keeping changing my comments. 

    It worked perfectly when my data is monthly basis.  

     

    My other data is daily baisis and I tried to use your famular again but it did not work.
    I will repost it separately as people may find it very useful. 

    All the best,

    Paris

5 Replies

    • paris's avatar
      paris
      Helper V

      Hello Ashish,

       

      Following instructions, I added three columns. When I try to apply changes, the following error is shown.

       

      OLE DB or ODBC error: [DataFormat.Error] We couldn't convert to Date.. 

       

      Where should I check?

       

      All the best,

      Paris

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        Go through each step in the Query Editor and stop at the one which returns an error.  Ensure that you have copied the correct M code from the Blog article i shared with you.

  •  

    Maintenance =
    CALCULATE (
    SUM ( Data[Capacity] ),
    FILTER (
    Data,
    Data[Start] <= MAX ( Dates[Date] )
    && Data[End] >= MIN ( Dates[Date] )
    )
    )+0
     
     
     
     
    • paris's avatar
      paris
      Helper V

      Hello Jihwan Kim

      Thank you so much for your reply. I am sorry for keeping changing my comments. 

      It worked perfectly when my data is monthly basis.  

       

      My other data is daily baisis and I tried to use your famular again but it did not work.
      I will repost it separately as people may find it very useful. 

      All the best,

      Paris