Forum Discussion
luisreyes
4 years agoFrequent Visitor
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...
- 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
sturlaws
Resident Rockstar
4 years agoHi 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
- luisreyes4 years agoFrequent Visitor
Sturla, your response is impressive, but i don't know is i'm doing well because only show the last month, i can't filter by any other month
Look Without any filter
And with february as filter