Forum Discussion

luisreyes's avatar
luisreyes
Frequent Visitor
4 years ago
Solved

Display moth value in card instead total

Hi,     I have this table of employees with: Name Surname Salary ID Number Department  Gender Date of payroll i'm trying to make a dashboard for payroll i have a bar visual for every mon...
  • sturlaws's avatar
    4 years ago

    Hi luisreyes,

     

    yes, if the model is as simple as you describe it, you can create a measure like this:

     

    NumberOfEmployees = 
    VAR _lastMonth =
        CALCULATE ( MAX ( 'Table'[Month] ), ALL ( 'Table' ) )
    RETURN
        IF (
            ISFILTERED ( 'Table'[month] ),
            COUNT ( 'Table'[Employee] ),
            CALCULATE (
                COUNT ( 'Table'[Employee] ),
                FILTER ( ALL ( 'Table'[Month]) , 'Table'[Month] = _lastMonth )
            )
        )

     

     

    Cheers,

    Sturla