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
tksnota
Post Patron
Post Patron

Clustered Column Based on Criteria

Hi,

 

I want to display the top 10 of the projects via clustered column based on YTD% ranging 45%-100% with YTD Margin ranging from 2k - 1m

 

tksnota_1-1728989316882.png

 

1 ACCEPTED SOLUTION

Tweaked it to exclude rows from showing final rank:

Top 10 within range only =

var matchingrows = 

Filter(AllSelected(table), [YTD%]>= 0.45 && [YTD%]<= 1 && [YTD margin]>= 2000 && [YTD margin]<= 1000000)

var curr = [YTD%]

Return
if(
[YTD%]>= 0.45 && [YTD%]<= 1 && [YTD margin]>= 2000 && [YTD margin]<= 1000000

,RankX(matchingrows , [YTD%],,Desc, Skip)

,BLank()
)

 

Add this into the visual to check it works and then use it as a filter 🙂


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

5 REPLIES 5
tksnota
Post Patron
Post Patron

i forgot to mention the YTD Margin and YTD% are both measures. so i tried the dax but i couldn't see these 2.

Tweaked it to exclude rows from showing final rank:

Top 10 within range only =

var matchingrows = 

Filter(AllSelected(table), [YTD%]>= 0.45 && [YTD%]<= 1 && [YTD margin]>= 2000 && [YTD margin]<= 1000000)

var curr = [YTD%]

Return
if(
[YTD%]>= 0.45 && [YTD%]<= 1 && [YTD margin]>= 2000 && [YTD margin]<= 1000000

,RankX(matchingrows , [YTD%],,Desc, Skip)

,BLank()
)

 

Add this into the visual to check it works and then use it as a filter 🙂


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

SamWiseOwl
Super User
Super User

Hi @tksnota  exactly, sorry I assumed it couldn't go above 100 xD


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

SamWiseOwl
Super User
Super User

HI @tksnota 

Create a measure using RankX that tests your conditions and then use this in the Fitler Pane or in the visual

Top 10 filter =

RankX(
Filter(AllSelected(table), [YTD%]>= 0.45 && [YTD margin]>= 2000 && [YTD margin]<= 1000000

,[YTD%],,Desc, Skip)

 

Either way apply a less than or equal to 10 filter.


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Thanks. I need to filter only margin between 45% - 100%. Can I add another ampersand showing <=1?

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.