HI Team,
I need some help with how to visualize the top non blank department for same period last year.
Data model is clean - Fact table connected to date dim.
The page im working on is filtered to current year.
Measures:
Total Contracts = DISTINCTCOUNTNOBLANK(Contract[ContractID])
Total Contracts SPLY = CALCULATE([Total Contracts], SAMEPERIODLASTYEAR(‘Date’[Date]))
What I want to do is in a card visual show the top department for this year
and show the top department for the previous year.
Putting the data into a table I can get what I want. Obviously If I just want to show the Department name in a card visual I have to take out the measure and then the context is lost. It makes sense you have to have the measure there. So is there a way to display only the department name.
I got to this measure but still does not work ??? any suggestions, I dont have a plan
Department SPLY =
VAR FilteredTable =
FILTER(
ADDCOLUMNS(
VALUES(Contract[Department]),
"RankX_TotalContractsSPLY",
RANKX(
FILTER(
ALL(Contract[Department]),
Contract[Department] <> BLANK()
),
[Total Contracts SPLY],
,
DESC, Dense
)
),
[RankX_TotalContractsSPLY] = 1
)
RETURN
MAXX(FilteredTable, Contract[Department])