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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Arete
Helper I
Helper I

X-Axis Constant Line with RankX

Hello Community!

 

I'd like to put an X-Axis Constant line on a Scatter Chart for the 10th largest Entity and I've created 3 measures:

 

Total Entities = 
CALCULATE(
    COUNT('tbl'[NER_PII_Values])
)
Total Entities Ranking = 
RANKX( 
    ALL('tbl'[NER_PII_Values]),
    [Total Entities],
    ,DESC
)
Entity Distribution X Constant = 
VAR TotalEntityRanking = [Total Entities Ranking]
RETURN
CALCULATE( 
    [Total Entities],
    FILTER(
        'tbl',
        TotalEntityRanking = 10
    )
)

 

On the Matrix, it looks great but when I use the measure in conditional formatting it shows as 0:

 

Arete_0-1670733151890.png

 

I'm expecting a line at 71,656.

 

Thank you in advance!

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Arete 

tried to simulate your issue and find the solution with such sample data:

FreemanZ_0-1670750095867.png

create a measure:

 

 

Value10th = 
VAR _table = 
ADDCOLUMNS(
    TableName,
    "Rank",
    RANKX(
        TableName,
        TableName[Value1],
        ,
        ASC
    )
)
RETURN
MINX(
    FILTER(_table, [Rank] = 10),
    TableName[Value1]
)

 

 

 

it worked like this:

FreemanZ_2-1670750152915.png

FreemanZ_3-1670750234736.png

 

View solution in original post

3 REPLIES 3
FreemanZ
Super User
Super User

hi @Arete 

tried to simulate your issue and find the solution with such sample data:

FreemanZ_0-1670750095867.png

create a measure:

 

 

Value10th = 
VAR _table = 
ADDCOLUMNS(
    TableName,
    "Rank",
    RANKX(
        TableName,
        TableName[Value1],
        ,
        ASC
    )
)
RETURN
MINX(
    FILTER(_table, [Rank] = 10),
    TableName[Value1]
)

 

 

 

it worked like this:

FreemanZ_2-1670750152915.png

FreemanZ_3-1670750234736.png

 

Hi, @FreemanZ  thanks for the reply. Unfortunately, it's still not working. Is it because I'm using a measure in the RANKX?

Entity Distribution X-Axis line = 
VAR tblRank = 
ADDCOLUMNS(
    'Top 250 Entities',
    "Rank",
    RANKX(
        'Top 250 Entities',
        [Total Entities],
        ,
        DESC
    )
)
RETURN
MINX(
    FILTER(tblRank, [Rank] = 10),
    [Total Entities]
)


The Total Entities measure is just a count:

 

Total Entities = 
CALCULATE(
    COUNT('Top 250 Entities'[NER_PII_Values])
)


Your suggestion comes back with Blank when it should be 71.624:

Arete_0-1670763790681.pngArete_1-1670763808926.png

 



It depends. It might be on different granularities. Try to replace the measure with a column reference: 'Top 250 Entities'[NER_PII_Values]

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors