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 everyone,
I would like to calculate the average value of top two values for every section per year&month,
I have tried ranking them first, but I couldn't have a correct ranking.
Do you guys have an idea of how to do it?
Solved! Go to Solution.
Hi @nqahman
Try this MEASURE
Measure =
AVERAGEX (
TOPN (
2,
FILTER (
ALL ( TableName ),
TableName[YEAR] = SELECTEDVALUE ( TableName[YEAR] )
&& TableName[MONTH] = SELECTEDVALUE ( TableName[MONTH] )
&& TableName[Section] = SELECTEDVALUE ( TableName[Section] )
),
TableName[VALUE], DESC
),
CALCULATE ( SUM ( TableName[VALUE] ) )
)
Hi @nqahman
Try this MEASURE
Measure =
AVERAGEX (
TOPN (
2,
FILTER (
ALL ( TableName ),
TableName[YEAR] = SELECTEDVALUE ( TableName[YEAR] )
&& TableName[MONTH] = SELECTEDVALUE ( TableName[MONTH] )
&& TableName[Section] = SELECTEDVALUE ( TableName[Section] )
),
TableName[VALUE], DESC
),
CALCULATE ( SUM ( TableName[VALUE] ) )
)
Thank you @Zubair_Muhammad for your response,
An error exists because of too many arguments in the FILTER function.
The maximum number is 2 arguments: Table name and one expression.
I have only 2 arguments in above formula for FILTER
1)
ALL ( TableName )
2)
TableName[YEAR] = SELECTEDVALUE ( TableName[YEAR] )
&& TableName[MONTH] = SELECTEDVALUE ( TableName[MONTH] )
&& TableName[Section] = SELECTEDVALUE ( TableName[Section] )
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 |
|---|---|
| 34 | |
| 26 | |
| 25 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 65 | |
| 35 | |
| 32 | |
| 25 | |
| 23 |