Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
reibalboaOMG
Helper I
Helper I

show top 2 or top 3 only

hi Everyone 

i have a question regarding on TOPN to show only top 2 and top 3, bottom 2, and bottom 3

reibalboaOMG_0-1678690144372.png

here is my sample slide the first image link is for top 1, second image is for top 2

and then another page same model but for the top bottom 

 

here's the sample data i've been working on

reibalboaOMG_1-1678690343999.png

do i need to make a new measure for this? and new ranking?

my formula is not giving me the right ranking

reibalboaOMG_2-1678690431422.pngreibalboaOMG_3-1678690493022.png

hope you guys can help me. thank you

 

 

17 REPLIES 17
reibalboaOMG
Helper I
Helper I

@Greg_Deckler i need it to be on the column because i'm using it to get the measurement for the week of update and date of post, so if we need another weekrank it's okay for me to create a new one

reibalboaOMG
Helper I
Helper I

@Greg_Deckler

i need that as a column but we can create new measure for weekrank if you need it

reibalboaOMG_0-1678699508769.png

 

@reibalboaOMG Pretty sure you need it and you will need to use it in that table visual. Or, you will need to aggregate your weekrank column somehow.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
reibalboaOMG
Helper I
Helper I

@Greg_Deckler sorry about that, try this and it's not the whole data because it has a capacity of a 20,000 characters 

reibalboaOMG
Helper I
Helper I

Week of UpdateType of KOLKOL NameSocial PlatformCampaign End DatePost Reach
1/22/2023MicroInfluencer 2IG1/31/20231,029
1/22/2023MicroInfluencer 3IG1/31/20231,300
1/22/2023MacroInfluencer 4IG1/31/20232,300
1/22/2023MegaInfluencer 5IG1/31/202319,021
1/22/2023Mid-TierInfluencer 6IG1/31/20231,000
1/22/2023NanoInfluencer 7IG1/31/2023920
1/22/2023NanoInfluencer 8IG1/31/2023982
1/22/2023MegaInfluencer 9IG1/31/20232,000
1/22/2023MacroInfluencer 10IG1/31/20231,329
1/22/2023NanoInfluencer 11FB1/31/2023150
1/22/2023MicroInfluencer 12FB1/31/20231,000
1/22/2023Mid-TierInfluencer 13FB1/31/20232,043
1/22/2023MegaInfluencer 14FB1/31/202325,000
1/22/2023MegaInfluencer 15FB1/31/20239,081
1/22/2023Mid-TierInfluencer 16FB1/31/20231,434
1/22/2023NanoInfluencer 17FB1/31/2023210
1/22/2023MacroInfluencer 18FB1/31/2023901
1/22/2023Mid-TierInfluencer 19FB1/31/20239,038
1/22/2023MacroInfluencer 20FB1/31/202322,894
1/22/2023MicroInfluencer 21TikTok1/31/20231,023
1/22/2023NanoInfluencer 22TikTok1/31/2023150
1/22/2023Mid-TierInfluencer 23TikTok1/31/202345,003
1/22/2023MacroInfluencer 24TikTok1/31/202324,002
1/22/2023MacroInfluencer 25TikTok1/31/202376,123
1/22/2023MegaInfluencer 26TikTok1/31/2023102,230
1/22/2023MegaInfluencer 27TikTok1/31/20231,231
1/22/2023MacroInfluencer 28TikTok1/31/202325,000
1/22/2023Mid-TierInfluencer 29TikTok1/31/202319,201
1/22/2023NanoInfluencer 30TikTok1/31/2023300
1/22/2023Mid-TierInfluencer 31TW1/31/20232,000
1/22/2023Mid-TierInfluencer 32TW1/31/2023521
1/22/2023Mid-TierInfluencer 33TW1/31/2023901
1/22/2023MegaInfluencer 34TW1/31/20231,923
1/22/2023NanoInfluencer 35TW1/31/2023220
1/22/2023NanoInfluencer 36TW1/31/2023712
1/22/2023MacroInfluencer 37TW1/31/20231,923
1/22/2023MegaInfluencer 38TW1/31/20232,932
1/22/2023MicroInfluencer 39TW1/31/20232,500
1/22/2023MicroInfluencer 40TW1/31/2023800
1/22/2023MacroInfluencer 41YT1/31/202318,200
1/22/2023NanoInfluencer 42YT1/31/20231,030
1/22/2023NanoInfluencer 43YT1/31/2023672
1/22/2023MicroInfluencer 44YT1/31/20233,500
1/22/2023MacroInfluencer 45YT1/31/20239,201
1/22/2023MicroInfluencer 46YT1/31/20231,231
1/22/2023MegaInfluencer 47YT1/31/2023132,022
1/22/2023MegaInfluencer 48YT1/31/202312,232
1/22/2023Mid-TierInfluencer 49YT1/31/20234,210
1/22/2023Mid-TierInfluencer 50YT1/31/202310,031
1/29/2023Mid-TierInfluencer 1IG1/31/20231,095
1/29/2023MicroInfluencer 2IG1/31/20231,954
1/29/2023MicroInfluencer 3IG1/31/20232,009
1/29/2023MacroInfluencer 4IG1/31/20232,503
1/29/2023MegaInfluencer 5IG1/31/202324,873
1/29/2023Mid-TierInfluencer 6IG1/31/20231,432
1/29/2023NanoInfluencer 7IG1/31/20231,021
1/29/2023NanoInfluencer 8IG1/31/20231,102
1/29/2023MegaInfluencer 9IG1/31/20234,092
1/29/2023MacroInfluencer 10IG1/31/20232,531
1/29/2023NanoInfluencer 11FB1/31/2023203
1/29/2023MicroInfluencer 12FB1/31/20231,934
1/29/2023Mid-TierInfluencer 16FB1/31/20239,304
1/29/2023NanoInfluencer 17FB1/31/2023500
1/29/2023MacroInfluencer 18FB1/31/202341,923
1/29/2023MicroInfluencer 21TikTok1/31/20231,110
1/29/2023NanoInfluencer 22TikTok1/31/2023502
1/29/2023Mid-TierInfluencer 23TikTok1/31/202346,921
1/29/2023MacroInfluencer 24TikTok1/31/202324,982
1/29/2023MacroInfluencer 25TikTok1/31/202376,543
1/29/2023MegaInfluencer 26TikTok1/31/2023150,983
2/5/2023NanoInfluencer 11FB1/31/2023250
2/5/2023MicroInfluencer 12FB1/31/20232,000
2/5/2023Mid-TierInfluencer 16FB1/31/20239,500
reibalboaOMG
Helper I
Helper I

@Greg_Deckler here's the sample data you might need

 

reibalboaOMG_0-1678696321844.png

 

and here's my formulas from measure= 

rankingforInfluencers = RANKX(ALL('Template (2)'[KOL Name]),CALCULATE('Template (2)'[thisweekcpm]),,DESC)
 
thisweekcpm = CALCULATE([Postimpcpm] ,ALLSELECTED('Template (2)'),'Template (2)'[weekrank] = MAX('Template (2)'[weekrank]))
 
weekrank = RANKX(ALL('Template (2)'),'Template (2)'[Week of Update],,ASC,Dense)
 
Postimpcpm =
1000 * DIVIDE(SUM('Template (2)'[Cost/Post]), SUM('Template (2)'[Post Impression]))

 

@reibalboaOMG Pretty sure your weekrank is a column and it needs to be a measure. See attached PBIX file below signature.

weekrank measure = RANKX(ALL('Template (2)'),CALCULATE(MAX('Template (2)'[Week of Update])),,ASC,Dense)

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@reibalboaOMG I'm not typing all that. Please post your data as text.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
reibalboaOMG
Helper I
Helper I

@Greg_Deckler now it shows only 1 rank 

reibalboaOMG_0-1678695613618.png

 

@reibalboaOMG Any chance you can post sample data as text as well as the formula for [thisweekcpm] so I can mock this up properly?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
reibalboaOMG
Helper I
Helper I

@Greg_Deckler  here's the new measure:
rankingforInfluencers = RANKX(ALL('Template (2)'[KOL Name]),[thisweekcpm],,DESC)
reibalboaOMG_0-1678693886245.png

here's the output, i don't know why but i have only 1-4 per influencer in the out put it's a lot

 

reibalboaOMG_1-1678694047202.png

it is suppose to look like this

@reibalboaOMG Try:

rankingforInfluencers = RANKX(ALL('Template (2)'[KOL Name]),CALCULATE([thisweekcpm]),,DESC)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
reibalboaOMG
Helper I
Helper I

@Greg_Deckler can i have a sample formula for this? 

thank you very much for the response 

@reibalboaOMG If you paste your formula first as plain text, I will fix it for you.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@reibalboaOMG I would suggest using the Top N filtering in the filter pane. Otherwise, since you are using a measure it appears, wrap your expression (2nd parameter) in CALCULATE. I just made a video on this topic that comes out later this week on Microsoft Hates Greg (Microsoft Hates Greg - YouTube). In the mean time see if this helps, To *Bleep* with RANKX! - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

hey @Greg_Deckler i doing the TopN right now but its not that simple of filtering, like for example: okay i already filtered the top 1 on the first then how can i filtered the top second?

@reibalboaOMG OK, then just fix your ranking by tossing in the random CALCULATE function for your expression.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.