Forum Discussion

OliTFD's avatar
OliTFD
Regular Visitor
4 years ago
Solved

How to work with tables using security roles: Calculations only for fitting dates

My problem is a little difficult to explain: I use BI to show our fellows their corresponding dates, therefore I use the roles. One of the tables filtered for the role is a date table called "Schult...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi OliTFD ,

    You can create a measure as below, please find the details in the attachment.

    Schooldays Running Total = 
    VAR _mindate =
        CALCULATE ( MIN ( 'Schultage'[Date] ), ALLSELECTED ( 'Schultage' ) )
    VAR _schooldays =
        CALCULATE (
            COUNT ( 'Schultage'[Is schoolday] ),
            FILTER (
                ALLSELECTED ( 'Schultage' ),
                'Schultage'[Is schoolday] = 1
                    && 'Schultage'[Date] <= SELECTEDVALUE ( 'Schultage'[Date] )
                    && 'Schultage'[Date] >= _mindate
            )
        )
    RETURN
        _schooldays

    Best Regards