Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Chart with number boolean

Hi,

 

My dataset is a calendar of this kind :

 

For each date i have the year and boolean opendays

I would like to create a graph which count the number of open days by year like Excel :

 

I create a measure but the result is not correct :

Number open=
CALCULATE(
    COUNTROWS(
            FILTER(Date_Calendrier;Date_Calendrier[Ouvrés]=TRUE()
                    )
            )
        )

How can i resolve my problem ?

 

Thanks

  • Hi Anonymous 

     

    Please share a sample of your data in a format that can be copied (paste it into the post from excel, not a screen shot) and include samples from each table involved.

     

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I have problem to import my array :

    date            year   Open
    01/01/2018 2018 FALSE
    02/01/2018 2018 TRUE
    03/01/2018 2018 TRUE
    04/01/2018 2018 TRUE
    05/01/2018 2018 TRUE
    06/01/2018 2018 TRUE
    07/01/2018 2018 FALSE
    08/01/2018 2018 TRUE
    09/01/2018 2018 TRUE
    10/01/2018 2018 TRUE
    31/12/2018 2018 TRUE
    01/01/2019 2019 FALSE
    02/01/2019 2019 TRUE
    03/01/2019 2019 TRUE
    04/01/2019 2019 TRUE
    05/01/2019 2019 TRUE
    06/01/2019 2019 TRUE

  • v-diye-msft's avatar
    v-diye-msft
    Community Support

    Hi Anonymous 

     

    let me know if you'd like to get below result:

    Add the measure: 

    Measure = CALCULATE(DISTINCTCOUNT('Table'[date]),FILTER('Table',[Open]="TRUE"))

    • Anonymous's avatar
      Anonymous
      Not applicable

       

      Hi  v-diye-msft 

       

      Thank you, that's ok in this case.

       

      In my case, i have two data sets :

      - date table with a status open or not for each day

      - data table which n lines for each month of each year.

       

      I created a link between both tables in using date field.

      I would like to know number of open days of year select by second tables.

      The measure shows the number of open days of keys select

       

      The easiest way is in adding a second date data set without link with data, but it's not correct for me to have two date calendars.

       

      Ex Data table :

       

      Thanks

      • v-diye-msft's avatar
        v-diye-msft
        Community Support

        Hi Anonymous 

         

        Please share a sample of your data in a format that can be copied (paste it into the post from excel, not a screen shot) and include samples from each table involved.