Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MorenoRichard
New Member

"Other" category in the last row of a table visual (RANKX and OTHER)"

I use the command below to create a table to select the top five quantities, putting the rest into the "Others" category. I would like the "Others" row to be at the bottom of a table visual.

 

TopMedicosPorEstados =
VAR _top = 5
VAR _TotalOutros =
    IF (
        SELECTEDVALUE ( '~TEMP_UF_MEDICOS'[UF] ) = "Outros",
        CALCULATE (
            [nMedicosRegulares],
            FILTER ( ALL ( '~TEMP_UF_MEDICOS'[UF] ), [nRankMedicos] > _top )
        )
    )
VAR _TotalTop =
    IF ( [nRankMedicos] <= _top, [nMedicosRegulares], _TotalOutros )
RETURN
    _TotalTop
 
Where 
nRankMedicos =
RANKX ( ALL ( '~TEMP_UF_MEDICOS'[UF] ), [nMedicosRegulares],, DESC )
and
nMedicosRegulares =
CALCULATE (
    DISTINCTCOUNT ( DIM_MEDICOS[CPF] ),
    DIM_MEDICOS[DESCRICAO_SIT] = "Regular"
 
See the table: (outros = others)
MorenoRichard_0-1714499645497.png

 

 
Any idea? Thanks!
1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1714540691333.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
MorenoRichard
New Member

You're genius. Thanks!

 

ThxAlot
Super User
Super User

ThxAlot_0-1714540691333.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors