Forum Discussion

fedorez's avatar
fedorez
Regular Visitor
8 years ago
Solved

Dynamic histogram?

Hello! Could you help me, please. I have a table with field adr_id and two dates -  date_start and date_end. I want to show slicer to set the range of dates , and show a histogram with two bins - ...
  • Anonymous's avatar
    Anonymous
    8 years ago

    fedorez,

    Create the following measures in your table. Please note that there is no relationship between your table and calendar table.

    mindate = MIN('Date'[DateKey])

    Maxdate = MAX('Date'[DateKey])

    countinrange = CALCULATE(COUNTA(Table[adr_id]),FILTER(Table,Table[date_start]>=[mindate]&&Table[date_end]<=[Maxdate]))

    countnotinrange = CALCULATE(COUNTA(Table[adr_id]),FILTER(Table,Table[date_start]<=[mindate]||Table[date_end]>=[Maxdate]))




    Regards,
    Lydia

  • Anonymous's avatar
    Anonymous
    8 years ago

    fedorez

    You can create one chart to display the measures, see the example below.


    Regards,
    Lydia