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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

SOLVED: RANKX if more than column value

Hi,

 

I want to rank campaigns based on their clickthrough rate but I would only want to rank those with total emails delivered of over 200. 

 

Here's my DAX: 

 

 

Rank Campaign by CTR = 
    IF(
        [Total Emails Delivered]>=200,
        RANKX(ALLSELECTED('Email Analysis'[Campaign Name]),[Clickthrough Rate],,DESC),BLANK())

 

 

 

But in my table, it's seems to start the rank at 2 or 3:

FaridNajmi_1-1628938672675.png

 

Any way to fix this?

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Rico,

 

Thanks for this.

 

I've managed to solve the issue with this measure:

 

    IF([Total Emails Delivered] >= 200,
            RANKX(FILTER(
                ALLSELECTED('Campaign and Group Slicer'[Campaign Name]),[Total Emails Delivered]>=200),[Clickthrough Rate]))

 

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi @Anonymous 

Try this measure.

Rank Campaign by CTR =
IF (
    HASONEVALUE ( 'Email Analysis'[Campaign Name] ),
    IF (
        [Total Emails Delivered] > 200,
        RANKX (
            FILTER (
                ALL ( 'Email Analysis' ),
                'Email Analysis'[Email Group] = MAX ( 'Email Analysis'[Email Group] )
                    && [Total Emails Delivered] > 200
            ),
            [Click through.Rate],
            ,
            DESC
        ),
        BLANK ()
    ),
    BLANK ()
)

My result in my sample is as below.

1.png

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Rico,

 

Thanks for this.

 

I've managed to solve the issue with this measure:

 

    IF([Total Emails Delivered] >= 200,
            RANKX(FILTER(
                ALLSELECTED('Campaign and Group Slicer'[Campaign Name]),[Total Emails Delivered]>=200),[Clickthrough Rate]))

 

Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur,

 

Unfortunately due to my company's policy, I'm unable to share the files with you.

 

Is there a workaround where you can still help me?

Greg_Deckler
Community Champion
Community Champion

@Anonymous Maybe:

Rank Campaign by CTR = 
        RANKX(ALLSELECTED('Email Analysis'[Campaign Name]),[Total Emails Delivered]>=200,[Clickthrough Rate],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...
Anonymous
Not applicable

Hey @Greg_Deckler,

 

Unfortunately this didn't solve it. Here's the outcome:

 

FaridNajmi_0-1629012273064.png

 

@Anonymous Can you post what is displayed in See details? Also, even better, can you post sample data? Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



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...
Anonymous
Not applicable

Hi @Greg_Deckler,

 

Thanks for the tips!

 

Fairly new to Power Bi and the community so really appreciate the help. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors