Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I would like to ask for your help in making my ranking dax dynamic based on filters selected. I have here my DAX, it is getting the correct ranking and values but it is only static and not changing based on my filter selection.
I have a seperate table where in I can filter any dimension..
Here's my dax:
New Table 2 =
VAR _topNnumber = 5
VAR _totalsales =
SUM ( Sales2[Sales] )
VAR _topfivesales =
CALCULATE (
SUM ( Sales2[Sales] ),
TOPN (
5,
SUMMARIZE ( Sales2, Sales2[Category] ),
CALCULATE ( SUM ( Sales2[Sales] ) ), DESC
)
)
VAR _topfivetable =
ADDCOLUMNS (
TOPN (
_topNnumber,
SUMMARIZE ( Sales2, Sales2[Category] ),
CALCULATE ( SUM ( Sales2[Sales] ) ), DESC
),
"@Sales", CALCULATE ( SUM ( Sales2[Sales] ) ),
"@Ranking",
RANKX (
SUMMARIZE ( Sales2, Sales2[Category] ),
CALCULATE ( SUM ( Sales2[Sales] ) ),
,
DESC
),
"@contribution", FORMAT ( CALCULATE ( SUM ( Sales2[Sales] ) ) / SUM ( Sales2[Sales] ), "#0.00%" )
)
VAR _otherstable =
{
( "Others", _totalsales - _topfivesales, _topNnumber + 1, FORMAT ( ( _totalsales - _topfivesales ) / _totalsales, "#0.00%" ) )
}
RETURN
UNION ( _topfivetable, _otherstable )
Thank you in advance!
Hi @icdns ,
In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?
Thanks for your efforts & time in advance.
Best regards,
Community Support Team_ Binbin Yu
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 49 | |
| 44 |