This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hai All ,
I want to Fetch TOP 10 Keywords Based on different Columns (Clicks, Cost,Impressions)
How it will be Done using DAX
Solved! Go to Solution.
Hi @AlanP514 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Clicks_Rank =
RANKX(ALL('Table'),CALCULATE(SUM('Table'[Clicks])),,ASC)Cost_Rank =
RANKX(ALL('Table'),CALCULATE(SUM('Table'[Cost])),,ASC)impressions_Rank =
RANKX(ALL('Table'),CALCULATE(SUM('Table'[impressions])),,ASC)
2. Use Enter data to create a Slice Table.
3. Create measure.
Rank =
var _select=SELECTEDVALUE(Slice_Table[Slice])
return
SWITCH(
TRUE(),
_select="Click_Rank",[Clicks_Rank],
_select="Cost_Rank",[Cost_Rank],
_select="impressions_Rank",[impressions_Rank])Flag =
IF(
[Rank]<=10,1,0)
4. Use the [Slice] slicer of Slice_Table, and put [Flag] into Filter, and set is =1.
5. Result:
When Cost_Rank is selected, the top 10 rankings with cost are displayed.
When the selection is impressions_Rank, the top 10 ranking of impressions is displayed.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @AlanP514 ,
I created some data:
Here are the steps you can follow:
1. Create measure.
Clicks_Rank =
RANKX(ALL('Table'),CALCULATE(SUM('Table'[Clicks])),,ASC)Cost_Rank =
RANKX(ALL('Table'),CALCULATE(SUM('Table'[Cost])),,ASC)impressions_Rank =
RANKX(ALL('Table'),CALCULATE(SUM('Table'[impressions])),,ASC)
2. Use Enter data to create a Slice Table.
3. Create measure.
Rank =
var _select=SELECTEDVALUE(Slice_Table[Slice])
return
SWITCH(
TRUE(),
_select="Click_Rank",[Clicks_Rank],
_select="Cost_Rank",[Cost_Rank],
_select="impressions_Rank",[impressions_Rank])Flag =
IF(
[Rank]<=10,1,0)
4. Use the [Slice] slicer of Slice_Table, and put [Flag] into Filter, and set is =1.
5. Result:
When Cost_Rank is selected, the top 10 rankings with cost are displayed.
When the selection is impressions_Rank, the top 10 ranking of impressions is displayed.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you for the wonderful explanation
@AlanP514 , these are measures (of with sum) you need create 3 measures
Assuming you have measures
Clicks, Cost,Impressions
Top 10= calculate([Clicks], TOPN(10,allselected(Table[keywords]),[Clicks],DESC), values(Table[keywords]))
Top 10= calculate([Cost], TOPN(10,allselected(Table[keywords]),[Impressions],DESC), values(Table[keywords]))
Top 10= calculate([Impressions], TOPN(10,allselected(Table[keywords]),[Impressions],DESC), values(Table[keywords]))
Check out the May 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 |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 27 | |
| 23 | |
| 18 |