Forum Discussion
arjun17697
1 year agoNew Member
Stacked Chart with labels
I have written a DAX code below: Ranking =
VAR _Top_Concept=RANKX(ALL(Dim_Concept[Concept Cleaned]),[EmployeeCount],,DESC)
VAR _bottom_Concept=RANKX(ALL(Dim_Concept[Concept Cleaned]),[...
Angith_Nair
Continued Contributor
1 year agoHi arjun17697
You’ll need to filter your data so that only the top two overall "Function" values based on employee count are displayed across experience groups. Please find the adjustment to your DAX measure to rank by employee count and create a filtered measure for visualization.
Create a calculated table to identify the top functions based on total employee count across all experience groups.
Top2Functions =
TOPN(
2,
SUMMARIZE(
Dim_Function,
Dim_Function[Function],
"TotalEmployeeCount", SUM(Fact_Employee[EmployeeCount])
),
[TotalEmployeeCount],
DESC
)Update your ranking measure to filter only the functions in this top two list and stack them by experience group.
Ranking =
VAR _SelectedFunction = SELECTEDVALUE(Dim_Function[Function])
VAR _IsTop2 = CALCULATE(
COUNTROWS('Top2Functions'),
'Top2Functions'[Function] = _SelectedFunction
)
RETURN
IF(
_IsTop2 > 0,
[EmployeeCount],
BLANK()
)