Forum Discussion

EFI's avatar
EFI
Icon for Helper I rankHelper I
1 year ago
Solved

Slicer with days AND hours ?

Hello there,   I start creating a dashboard to monitor the energy comsumption in some of our plants and I encounter some issue with the timestemp / slicer, I try some workaround but couldn't find s...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi EFI ,

    Regarding your question, 'Between' style slicers can only have values from small to large by default. How about creating two slicers?

    I added a rectangle to cover the excess slicer section.

     

    MEASURE = 
    VAR _startHour =
        MIN ( 'BeginHour'[Hour] )
    VAR _endHour =
        MAX ( 'EndHour'[Value] )
    VAR _startDate =
        MIN ( 'Calendar'[Date] )
    VAR _endDate =
        MAX ( 'Calendar'[Date] )
    VAR _curren_x_axis_date_hour =
        SELECTEDVALUE ( ENERGY[timestamputc] )
    VAR _curren_x_axis_date =
        SELECTEDVALUE ( ENERGY[timestamputc - Date] )
    VAR _result =
        IF (
            _curren_x_axis_date = _startDate
                && HOUR ( _curren_x_axis_date_hour ) >= _startHour,
            SUM ( ENERGY[value] ),
            IF (
                _curren_x_axis_date = _endDate
                    && HOUR ( _curren_x_axis_date_hour ) <= _endHour,
                SUM ( ENERGY[value] ),
                IF (
                    _curren_x_axis_date <> _startDate
                        && _curren_x_axis_date <> _endDate,
                    SUM ( ENERGY[value] )
                )
            )
        )
    RETURN
        _result

     


    Best Regards,
    Wenbin Zhou