Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Re: Start Date and Date visual

Hi,

 

I have a table with the contract name, start date and end date. My date field are mm/dd/yyyy. I need to show a visual with count how many new contract came(started date) in a month and how many contracts terminated in a month(end date) when user selects one month. 

 

End Date Null means that contract is still active

 

 

 
  • Hi Anonymous ,

     

    1. Ceate a date table and related it to the fact table.

    date = ADDCOLUMNS(CALENDARAUTO(),"Y Month",FORMAT([Date],"YYYY-MMM"))

     

    2. After that, to create two measures as below to get the excepted result.

    end = CALCULATE(COUNTROWS('Table'),USERELATIONSHIP('Table'[End Date],'date'[Date]))
    Start = CALCULATE(COUNTROWS('Table'))

     

     

     

  • Anonymous's avatar
    Anonymous
    6 years ago

    Thank you. Your solution was easy to create and understood clearly.

5 Replies