March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I'm trying to create a ranking of the accounts count of this table.
That table is a duplicate of another table that has the real data. I created that table using the command "grouping by" and with the operation count.
Basically, I want to know the rank of every ACCOUNT according to the number of appearances (Count) that every account has.
I created this formula, but it doesn't work, as it simply shows "1" for all accounts.
Solved! Go to Solution.
Hi @Anonymous ,
You can use this measure
Rank Account Name = RANKX( ALL(Table3[Account Name]), CALCULATE(SUM(Table3[Count])),,DESC,Dense)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Hi @Anonymous ,
You can use this measure
Rank Account Name = RANKX( ALL(Table3[Account Name]), CALCULATE(SUM(Table3[Count])),,DESC,Dense)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
@Anonymous You are getting 1 because CALCULATE inititates Context Transition and adds the currently iterated Account Name to the filter context and the formula becomes,
=
CALCULATE (
COUNTROWS ( 'Tabla Account Count' ),
'Tabla Account Count'[Account Name] = "Something", -- Coming from context transition
ALLEXCEPT ( 'Tabla Account Count', 'Tabla Account Count'[Count] )
)
Since ALLEXCEPT being a CALCULATE modifier is evaluated after context transition the COUNTROWS that you get are for whole table and can only be filtered by the Count column.
Try this code instead:
Rank =
RANKX (
ALL ( 'Tabla Account Count'[Account Name] ),
CALCULATE ( COUNTROWS ( 'Tabla Account Count' ) ),
,
DESC,
DENSE
)
Hi. Thanks! But I received the same number 1 for all accounts in the ranking 😞
@Anonymous , why allexpect
Rank =
RANKX (
ALL ( 'Tabla Account Count'[Account Name] ),
CALCULATE (
COUNTROWS ( 'Tabla Account Count' ),
),
,
DESC,
DENSE
)
this will rank for COUNTROWS ( 'Tabla Account Count' )
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415
The following error appears :
Argument '2' in CALCULATE function is required
I don't know exactly what to put since I'm new in DAX 😕
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
18 | |
16 | |
13 |