This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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 April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 28 | |
| 28 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 65 | |
| 35 | |
| 33 | |
| 25 | |
| 24 |