Forum Discussion

Aho00's avatar
Aho00
Regular Visitor
8 months ago
Solved

Chart without data

Hello, I need some help I would like to count the rows from my data table and show them in a chart. And I want it to display 0 when there is no data for the one no showing up in my data table. My da...
  • danextian's avatar
    8 months ago

    Hi Aho00 

     

    Adding 0 forces DAX to add 0 even for the rows that are not supposed to be there or within the slicer selection. Add a condition do your measure that checks whether a specific date is within the selected range

    VAR _start =
        MINX ( ALLSELECTED ( CalendarTable ), CalendarTable[date] )
    VAR _end =
        MAXX ( ALLSELECTED ( CalendarTable ), CalendarTable[date] )
    RETURN
        IF (
            SELECTEDVALUE ( CalendarTable[date] ) >= _start
                && SELECTEDVALUE ( CalendarTable[date] ) <= _end,
            [your measure] + 0
        )